I'm attempting to use the Sort method on a DateTime field within a DataView and it is sorting as a text field instead of a DateTime field when it's displayed in the datagrid.
When sorting the field in SQL Server2K it sorts correctly so I must be losing the DateTime declaration when I fill the datatable or the dataview. My abbreviated code looks like the following:
DataTable dt = ds.Tables[0];
dv = dt.defaultview;
dv.Sort = "EnteredDate desc";
dgTestCases.DataSource = dv;
dgTestCases.DataBind();
Any ideas on how to sort the DataView on the datetime field as a true Date sort?
Thanks.
When sorting the field in SQL Server2K it sorts correctly so I must be losing the DateTime declaration when I fill the datatable or the dataview. My abbreviated code looks like the following:
DataTable dt = ds.Tables[0];
dv = dt.defaultview;
dv.Sort = "EnteredDate desc";
dgTestCases.DataSource = dv;
dgTestCases.DataBind();
Any ideas on how to sort the DataView on the datetime field as a true Date sort?
Thanks.