Home › Forums › WinForms controls › Xceed Grid for WinForms › Custom grouping not working for me
I’m using the grid’s group area to allow users to drag columns for grouping.
One of my columns is of a custom data type and requires custom code for comparing.
For sorting the column, I created a custom IComparer and set the column’s DataComparer. This works well for sorting, but not for grouping.
But the Compare method doesn’t get called when I group this column. And each row ends up grouped by itself.
What do I need to do to get this custom grouping to work?
Imported from legacy forums. Posted by Buzz (had 823 views)
Even in the “Grouping” sample the MySubjectDataComparer’s Compare method doesn’t get called when I group by Subject.
The documentation for DataComparer says “Gets or sets an instance of a class which implements the IComparer
interface in order to compare the column’s data during grouping and sorting”
So how do I get this to work?
Imported from legacy forums. Posted by Buzz (had 387 views)
Got it now. The GroupRow’s GroupTemplate needs to be set to my custom Group.
For some reason this Grid and the WPF DataGrid keep kicking my butt. There are many ways to design controls like these, and I guess my way of thinking doesn’t match.
Oh well. But thanks for the quick, helpful response. [*-)]
Imported from legacy forums. Posted by Buzz (had 1072 views)