Example of Drag Selection in Blazor DataGrid Component

DataGrid / Selection / Drag Selection

This example shows the Blazor Grid Component with a draggable row and cell selection. By dragging a grid with your mouse or touch, you can select multiple rows or cells.

1 of 7 pages (75 items)
Properties
Selection Mode
Cell Selection Mode

The Blazor DataGrid allows you to select a row or a cell by dragging your mouse or touching the screen. Set the AllowDragSelection property of the GridSelectionSettings to true to enable the drag selection feature.

Drag Selection supports two types of cell selection modes, which can be set using the GridSelectionSettings component's CellSelectionMode property. They are,

  • Flow - A range of cells is selected between the start and end indexes, which includes cells in between rows.
  • Box - A range of cells is selected from the start and end column indexes that include cells in between rows within the range.

In this demo, DataGrid is rendered in Row selection mode. You can change the selection Mode and CellSelectionMode (take note of the selection mode).

Additionally, the Selection Type should be set to Multiple in order to select multiple rows or cells by dragging the mouse.

More information about Drag selection feature can be found in this documentation section.

Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE