Thanks for the answer.
The demo did not help me, as it only specifies the default sorting for the whole object, but not by column - I would have prefered some "IComparer" (not IComparable) for the member. For the generic sort descriptor, I would have to know the details of the item type and have to manually generate the sort desscriptors.
Instead, I created my own SortDescriptor and overrided the CreateSortKeyExpression:
CustomColumnSortDescriptor : ColumnSortDescriptor
Expression CreateSortKeyExpression(ParameterExpression parameterExpression)
var expression =
expression = SortKeyHelper.CreateSortStringExpression(expression);
and added it manually in the Sorting event to the SortDescriptors of the grid. There was only a small problem that even if I said
in the sorting event, the GridView tried to replace my SortDescriptor with a default one. However, luckily you provide a CollectionChanging event for the SortDescriptors, which I could cancel so my custom sort descriptor stays in the collection. However - this is only a workaround - is there any way to stop the GridView from generating it's own sort descriptors?
Regarding the data type: I am using all kinds of data, from strings to numbers to objects (e.g. in ComboBoxColumns). My problem was that I was using the GroupMemberPath for strings, too, converting them to a SortString - which was not really necessary. So for the string columns, I now see the advanced filter options. For the other columns, however, the filter operators are somewhat useless (if I want to exclude or include some specific value, I can use the discrete values...) - I would like to hide these fields completely for these columns...