Data Grid - Single Row Selection

The Data Grid component allows users to click a row to select it. Use the SingleSelectedDataRow property to specify the selected data row in code. To track selection changes in this mode, use the SingleSelectedDataRowChanged event or the two-way synchronization as demonstrated in this module.

Selected Product: HL Road Frame - Black, 58
HL Road Frame - Black, 58 Components Road Frames
HL Road Frame - Red, 58 Components Road Frames
Sport-100 Helmet, Red Accessories Helmets
Sport-100 Helmet, Black Accessories Helmets
Mountain Bike Socks, M Clothing Socks
Mountain Bike Socks, L Clothing Socks
Sport-100 Helmet, Blue Accessories Helmets
AWC Logo Cap Clothing Caps
Long-Sleeve Logo Jersey, S Clothing Jerseys
Long-Sleeve Logo Jersey, M Clothing Jerseys

Data Grid - Multiple Row Selection

Use the SelectionMode property to activate multiple selection in the Data Grid component. The DataGridSelectionMode.MultipleSelectedDataRows selection mode allows you to specify the selected data rows via the MultipleSelectedDataRows property. To track selection changes in this mode, use the MultipleSelectedDataRowsChanged event or the two-way synchronization as demonstrated in this module.

Users can click multiple data rows to select them: to add/remove a row to/from the selection, click the row with the Ctrl key pressed. To select multiple rows, click the first row, hold down the Shift key, and click the last row you want to be selected.

HL Road Frame - Black, 58 Components Road Frames
HL Road Frame - Red, 58 Components Road Frames
Sport-100 Helmet, Red Accessories Helmets
Sport-100 Helmet, Black Accessories Helmets
Mountain Bike Socks, M Clothing Socks
Mountain Bike Socks, L Clothing Socks
Sport-100 Helmet, Blue Accessories Helmets
AWC Logo Cap Clothing Caps
Long-Sleeve Logo Jersey, S Clothing Jerseys
Long-Sleeve Logo Jersey, M Clothing Jerseys
Selected products:
  • HL Road Frame - Black, 58
  • HL Road Frame - Red, 58
  • Sport-100 Helmet, Red
  • Sport-100 Helmet, Black

Data Grid - Multiple Selection with Optimized Performance

The Data Grid also provides the DataGridSelectionMode.OptimizedMultipleSelection selection mode. In this mode, the Data Grid stores information about the selection to improve performance. For example, when the number of selected rows exceeds the number of unselected rows, the grid stores information about unselected rows only.

To use this mode, set the KeyFieldName property to the name of the data source key field. To track selection changes in this mode, use the OptimizedMultipleSelectionChanged event as demonstrated in this module.

The code below sets the SelectAllMode property to DataGridSelectAllMode.AllPages. It allows users to select all grid’s data rows simultaneously via the Select All checkbox in the DxDataGridSelectionColumn column.

The total count of selected rows: 0 (stored selected rows: 0, stored unselected rows: 0)
HL Road Frame - Black, 58 Components Road Frames
HL Road Frame - Red, 58 Components Road Frames
Sport-100 Helmet, Red Accessories Helmets
Sport-100 Helmet, Black Accessories Helmets
Mountain Bike Socks, M Clothing Socks
Mountain Bike Socks, L Clothing Socks
Sport-100 Helmet, Blue Accessories Helmets
AWC Logo Cap Clothing Caps
Long-Sleeve Logo Jersey, S Clothing Jerseys
Long-Sleeve Logo Jersey, M Clothing Jerseys