This question is locked. New answers and comments are not allowed.
Hey All,
I have a RadGridView with several columns in it...some strings, some DateTime, Some Integer.
I need a way to sort these columns...I am overriding the Sorting event and doing my sorting as such:
IOrderedEnumerable<TableViewRow> sortedValue;
sortedValue = from item in dgStudyList.Items.OfType<TableViewRow>()
orderby ConvertToDateTime(item.Data[columnName] as string) ascending
select item;
grid.ItemsSource = sortedValue.ToList();
this works fine and is okay.
The problem I run into is I want to do an initial sort on the table on initialization. When I use the SortDescriptors property to sort, it sorts by string...not by int or dateTime (which works for the columns which have strings in them). However, if I initially do the sort using the above method (which is needed to sort by date, or int), the little triangle in the row headers (which show sort direction) do not get set. This seems like a pretty strait forward problem.
Is there any way to set those or do a sort which will set those arrows accordingly.
Thanks
Leon
I have a RadGridView with several columns in it...some strings, some DateTime, Some Integer.
I need a way to sort these columns...I am overriding the Sorting event and doing my sorting as such:
IOrderedEnumerable<TableViewRow> sortedValue;
sortedValue = from item in dgStudyList.Items.OfType<TableViewRow>()
orderby ConvertToDateTime(item.Data[columnName] as string) ascending
select item;
grid.ItemsSource = sortedValue.ToList();
this works fine and is okay.
The problem I run into is I want to do an initial sort on the table on initialization. When I use the SortDescriptors property to sort, it sorts by string...not by int or dateTime (which works for the columns which have strings in them). However, if I initially do the sort using the above method (which is needed to sort by date, or int), the little triangle in the row headers (which show sort direction) do not get set. This seems like a pretty strait forward problem.
Is there any way to set those or do a sort which will set those arrows accordingly.
Thanks
Leon
