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
120
Make grid sort on one column but without displaying sort indicator
posted

I want my Grid to sort on a single column. I want the sorting to occur automatically when rows are inserted and later when data is edited via the grid. The sort column is non-editable.

I don't want the user to do any re-sorting via the header, leaving the column header for select all.

Thanks.

 

 

 

 

 

 

 

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    What I would do is set the SortIndicator on the column you want sorted inside the InitializeLayout event of the grid. Then handle the BeforeSortChanged event and cancel it to prevent the user from making any changes.

    When new rows are added or existing rows are editing, the grid will not automatically updated the sort order because this might be jarring for the user. But you can do it in code. I would recommend using the AfterRowUpdate event and calling the RefreshSortPosition method on the row.