When clicking on Datagrid ColumnHeader - How is sorting taking place? And how to override it?
When clicking on a DataGrid ColumnHeader, the datagrid would automatically sort the data, if the underlying dataSource is a CollectionView.
How does it work internally, does it just add SortDescriptors() to the View in order to sort or does it utilize an IComparer class?
I think its rather using SortDescriptors, hence its so slow in sorting.
I have done some research and it says using
CollectionView.CustomSort = a class implementing IComparer
is much faster approach.
So in order to try this approach, how do I override the automatic sorting mechanism of DataGrid - when clicked on a columnheader - and do my own sorting with the CustomSort?
Any help on this is highly appreciated.开发者_JAVA百科
You can use the Sorting Event which will give you the Column they are using to sort and in which direction.
精彩评论