L
leo.hart
Hello,
Let's say I have a typed DataTable called "MyDataTable" and it has the
following columns:
ID: Integer
Name: String
StartDate: Date
DisplayName: String
ID, Name and StartDate are generally filled through an ADO.NET
DataAdapter call, but DisplayName should be based on expression.
MyDataTable will be used to populate a ComboBox, where ID is the
ValueMember and DisplayName is the DisplayMember.
So what I'm trying to do is create an Expression on my DisplayName
column:
MyDataTable.columnDisplayName.Expression = "ID + ' - ' + Name + ' - ' +
StartDate"
This works and does not throw an error, however it displays the
StartDate section in the wrong format. I would like to display
StartDate in the format of MM/dd/yyyy. Is there any way to do this?
Can I use methods like StartDate.ToString('MM/dd/yyyy') in a column
expression? I tried but it seems to throw an error.
Thanks,
Leo Hart
Let's say I have a typed DataTable called "MyDataTable" and it has the
following columns:
ID: Integer
Name: String
StartDate: Date
DisplayName: String
ID, Name and StartDate are generally filled through an ADO.NET
DataAdapter call, but DisplayName should be based on expression.
MyDataTable will be used to populate a ComboBox, where ID is the
ValueMember and DisplayName is the DisplayMember.
So what I'm trying to do is create an Expression on my DisplayName
column:
MyDataTable.columnDisplayName.Expression = "ID + ' - ' + Name + ' - ' +
StartDate"
This works and does not throw an error, however it displays the
StartDate section in the wrong format. I would like to display
StartDate in the format of MM/dd/yyyy. Is there any way to do this?
Can I use methods like StartDate.ToString('MM/dd/yyyy') in a column
expression? I tried but it seems to throw an error.
Thanks,
Leo Hart