In v13.2 and higher, Data Grid supports a built-in checkbox column for multiple row selection in grid Views. To activate this checkbox column, enable the GridView.OptionsSelection.MultiSelect option, and set the GridView.OptionsSelection.MultiSelectMode property to CheckBoxRowSelect
.
In v18.1 and later versions, you can sync row selected states with a Boolean field in the bound data source. A checkbox column's bound mode ensures that row selection persists whenever you filter or group grid data.
See the following topic for more information: Multiple Row Selection Using Built-In Check Column and Selection Binding.
This example shows how you can create a custom checkbox column to select rows in Data Grid. The checkbox column's header and group rows display check marks that allow users to toggle selection of all rows and row groups, respectively.
The GridCheckMarksSelection
class adds a checkbox column to a target grid View, implements the row selection functionality, and exposes methods to work with the row selection in code.