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
25
Turning off Grid sorting but allowing header clicks and sort arrow display
posted

Sounds Weird! Here's my explanation:

We use grid to display only a page full of data that we get from db using SQL query. Sorting on the SQL query is built based on how user wants to sort the data in the grid. I.e., we allow user to click on grid headers and set sort the way they want. So far so good.

The problem is that SQL sorts the data one way and grid sort it differently - especially the non-alphanumeric characters. Thus the sort looks broken.

We need grid to allow header click for sorting and the sort arrows to be displayed. However, it should just display the data table as is - without any further sorting.

One way I was thinking of doing was to give it a dummy sort routine that will always return 0 - thus it will not change the order of data rows.

Is there any other setting of the grid that will do this for me?

Thanks

Inderjit

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Inderjit,

    Not weird at all. It's perfectly reasonable and the grid is set up to handle cases like this. Just set HeaderClickAction on the Override to one of the "External" options. This will make the grid show the sort indicators, but not actually do any sorting. And you can handle the sorting of the data in the Before/AfterSortChange events of the grid.


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                e.Layout.Override.HeaderClickAction = HeaderClickAction.ExternalSortMulti;
            }

Children