Hi Jacqueline,
Based on the current structure of the DataGrid, selecting
rows only through the built-in checkbox column is not supported. However, you
can achieve your requirements through a workaround. To implement this, you
should use checkboxes at the sample level to select rows programmatically.
Additionally, you can restrict row selection when tapping on row contents to
meet your needs.
To implement this, use the Checkbox component in a
separate column at the sample level instead of the DataGrid's built-in
checkbox. In the ` DataGridSource.buildRow` method, return the checkbox if it's
a checkbox column. In the `Checkbox.onChanged` callback, set the
corresponding row to `DataGridController.selectedRow` to select rows
programmatically.
To disable selection when clicking on row cells, return `false`
from the `SfDataGrid.onSelectionChanging` callback. This will disable
selection for row cells.
For your reference, we have provided a simple sample that
demonstrates this approach. In this sample, you can select rows exclusively
through the checkbox, and tapping on row contents allows you to navigate to
another page. Please review the sample below for further details.
Regards,
Tamilarasan
Attachment:
Sample_d9d8a84.zip