In my WebDataGrid v12.2, i bind it to a datatable with columns of type String. In the Columnsorted event I implement a custom sort on the underlying datatable so i can sort on a column of type String but the values in each row represent DateTimes. the underlying datatable is sorted correctly, however, when i rebind it to the webdatagrid, the datagrid shows the rows sorted by the string values instead of the true DateTime values that they represent, resulting in an incorrect sort.
How can i force the webdatagrid to display the rows in the datatable in their correct order?
Hi wvusaf,
Please let me know if you have any other questions or concerns about this issue and I'll be glad to help you.
It is possible to undo our sorting by removing the sorted columns as mentioned in this forum thread:
http://ko.infragistics.com/community/forums/t/60320.aspx
The forum thread shows how to clear the entire list of sorted columns and if this is not desired, you can remove the current column that is being sorted with the following code during the ColumnSorted event:
// Remove the column we just sorted from our column collection. e.SortedColumns.Remove(e.SortedColumns[e.Column.Key]);
Then, you can use the suggestion in this forum thread to retain the sort indicator on the column header.
http://ko.infragistics.com/community/forums/t/45430.aspx
By removing the column from the SortedColumns collection, when binding the custom sorted data, the grid will not try to resort it by it's string value.
If you need further assistance with this, please let me know and I will be glad to help.