1 Reply Latest reply on Mar 13, 2008 7:51 AM by RBKB

    Programmatic Multiple column sort in advanced data grid

    RBKB Level 1
      I am using an advanced data grid, which receives data from a data provider every few seconds. Initially the data is sorted on two columns eg. colA & colB. But when the user clicks on the header to sort, the data grid should remember the sort order that user wants eg. sort 1st by colC and then by colB. I have been able to do this for one column using headerRelease event by calling a method on it. This method passes the column name based on the column index to the data provider, and the data provider sorts data according to this. But my main problem is how do I implement this for multiple column sort? No idea how to know which multiple headers were clicked and in which order. Can some body please help? Thanks in advance.
        • 1. Programmatic Multiple column sort in advanced data grid
          RBKB Level 1
          I am able to do the above by using the method which passes the sort information to data provider. But now the problem I am facing is I cannot use event.preventDefault(); along with that method. If I use event.preventDefault(); then it does not show the descending arrow on the column, nor does it sort on multiple columns.

          But if I do not use event.preventDefault(); then the problem I am getting is it remembers the previous sort order for a particular column. eg. If I sorted on col A (desc)+colB and now I sort on colC. Again if I click on col A, the data provider sorts on colA ascending shows it and then the grid refreshes sorting on col A but in descending order.

          Does somebody know how to get around this problem?