The WinForms Data Grid control supports multiple row selection using a built-in Check column in GridView
, BandedGridView
, and AdvBandedGridView
. To activate this checkbox column, set the GridView.OptionsSelection.MultiSelectMode property to CheckBoxRowSelect
and enable the GridView.OptionsSelection.MultiSelect option.
Note: 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.
Read the following help topic for more information: Multiple Row Selection Using Built-In Check Column and Selection Binding.
This example demonstrates how to create a custom checkbox column to select rows in the WinForms 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 selection-related methods.
- GridView.OptionsSelection.MultiSelect
- GridView.OptionsSelection.MultiSelectMode
- Multiple Row Selection Using Built-In Check Column and Selection Binding
(you will be redirected to DevExpress.com to submit your response)