Grid sorting with check boxes


I have a AdvWebGrid component, with usually several pages of data. The first column is a ctCheckBox column, used to select the items, the other 2 columns contain data. I can also sort the grid by either of the two data columns.

If I check a couple of rows (Item 2 and Item 5 say) and then sort the grid, I'd expect the checked rows to move with the items, however the same check boxes stay checked, and so it now shows two different items checked.

How can I sort the grid, and also keep the same items checked?



Unfortunately it's currently not supported to use column sorting in combination with a ctCheckBox column.
As an alternative you can use a ctDataCheckBox column. This type allows to the checkbox state to be saved as the cell value. This technique will make sure the same items remain checked after sorting.