Skip to content

Row selection

Pass a selection config to enable checkbox selection. In tree mode, set cascade: true for tri-state behavior: selecting a parent selects all descendants, and partial selection shows an indeterminate checkbox.

<DataGrid
data={rows}
columns={columns}
selection={{ mode: 'multi', cascade: true }}
onSelectionChange={(state) => {
console.log(state.selectedIds);
}}
/>;

Selected rows: 0

Label