Hi,
I have a custom IComparer bound to an UltraGridColumn with the SortComparer property.
Is there a good reason for the UltraGrid to call this custom IComparer by passing the UltraGridCell object to the compare method instead of the value of the Cell?
I see 2 inconveniences with this behavior:
I can't see the advantages.
Thanks.
The advantage is that you are not limited to just the value of the cells that are being sorted. Many people use the SortComparer on a column to sort that column by the values in a completely different column in the same row. You couldn't get to other cells or the row itself without a reference to the cells.
Oh... if you by "specificity", you mean that you can't use the same comparer for anything other than the grid, then you could create a sort've intermediary comparer.
Basically, this would be an IComparer class that holds a reference to another IComparer. In the Compare method, you would get the values from the UltraGridCells and then call off to the second comparer which only deals with the values and knows nothing about grid cells. The second comparer could then be used anywhere.