Hi,
I am using ultragrid group by feature. When I am using the code following:
ultragrid.DisplayLayout.Bands[0].SortedColumns.Add("Fruit", false, true);
The fruit column will be grouped by category e.g Apple, Banana, Peach in alphabetical order.
However, what if I do not want the group by rows order by alphabetical, but order by a specific rule that I am giving? e.g I want the order like Peach,Apple,Banana.
Thanks,
Xin
Xin,
To do this, you would need to write a class that implements the IComparer interface and assign an instance of that class to the Fruit column's GroupByComparer property. A similar approach can be taken for non-groupby rows by assigning this comparer to the SortComparer property of the column.
-Matt
Just an FYI - if you want the fruits to always sort in the same order, then you only need to use the SortComparer and not the GroupByComparer. You only need the GroupByComparer if you want the GroupByRows to sort a different way than the actual rows.