Home Forums WinForms controls Xceed Grid for WinForms Sorting in Xceed Grid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17226 |

    Hi,

    We are having a problem while attempting to sort a Xceed DetailGrid, which is databound.

    It seems to be sorting by ValueMember (i.e. the database field/ column that holds the id) instead of the DisplayMember ( i.e. the database field/ column that has the description, which is visible to the user via the UI).

    What is the proper way of sorting in such a scenario?
    Thanks,

    Varun

    Imported from legacy forums. Posted by Varun (had 980 views)

    User (Old forums)
    Member
    Post count: 23064

    Actually, I was able to solve the issue by writing a custom class DisplayValueDataComparer : IComparer.

    The following method had to be overridden

    int IComparer.Compare(object x, object y)
            {}

    Instead of passing the x, y values, the description for the same was passed,

    Cheers,

    Varun

     

    Imported from legacy forums. Posted by Varun (had 788 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.