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
375
ColumnHeader click event / Sorting Problem
posted

Hi,

my problem is that I have to visualize some values as images. So I have a datatable including columns of integers (0/1). In the UltraGrid I have referenced ValueLists for these columns. So after data was loaded different images will be shown in this columns to visualize an order or payment status for example. That is working fine. But if I want to sort the grid by that columns nothing happens when clicking at the column header. For all other columns the sorting is working correct. Maybe the sorting will not work if columns are referencing value lists?

What I want to know is how can I sort the grid by columns which has references to value lists or a how can I implement a single header click event to sort the grid programmatically. Can anyone help me?

Kind regards,

Ralf

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Ralf,

          The column is probably sorting by the image rather than by the value. Since all images are essentialy the same in terms of sort order, nothing happens.

        You should be able to get this to work the way you want, but how you do it depends on how you are setting up the list. 

        The first thing I would suggest is that you try playing around with the DisplayStyle property on the ValueList and see if a setting there will help.

        If that doesn't work, what you should do is write an IComparer class and assign it to the SortComparer property of the grid column. This will allow you to sort any way you want.

     

Reply Children