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.
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.