Hallo Telerik,
I want to sort the Rows in my Grid. I have accomplished this with the event handler "RadGridView_Sorting". My data are all strings, so I use an IComparer to sort the data (Integers) and then bind them to the RadGridView.
My data is sorted when I load the data for the first time, but the GridView doesn't show the sorted Column. With the following code, I get the sorted column.
Can I use the code with dynamic binding of the column? For example something like this:
When I bind the SortDirection, it works. But how can I bind the column to be sorted dynamically?
One more question: I have the data of the RadGridView bound to a collection in MVVM. When I load the RadGridView for the first time, I expect the sorting_event to be called. Why does it not happen?
Best Regards
I want to sort the Rows in my Grid. I have accomplished this with the event handler "RadGridView_Sorting". My data are all strings, so I use an IComparer to sort the data (Integers) and then bind them to the RadGridView.
My data is sorted when I load the data for the first time, but the GridView doesn't show the sorted Column. With the following code, I get the sorted column.
<telerik:RadGridView.SortDescriptors> <telerik:ColumnSortDescriptor Column="{Binding Columns[\Title\], ElementName=radGridView}" SortDirection="Ascending"/> </telerik:RadGridView.SortDescriptors>
Can I use the code with dynamic binding of the column? For example something like this:
<telerik:RadGridView.SortDescriptors> <telerik:ColumnSortDescriptor Column="{Binding Columns[\{Binding SortMember}\], ElementName=radGridView}" SortDirection="{Binding SortDirection}"/> </telerik:RadGridView.SortDescriptors>
When I bind the SortDirection, it works. But how can I bind the column to be sorted dynamically?
One more question: I have the data of the RadGridView bound to a collection in MVVM. When I load the RadGridView for the first time, I expect the sorting_event to be called. Why does it not happen?
Best Regards