Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
194
UltraGrid Sort Comparer
posted

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:

  • Performances are breaking down with the double cast of objects into UltraGridCells
  • The specificity of the IComparer implemented

I can't see the advantages.

Thanks.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    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.

     

Children