I'm working on a React project that uses Material-UI, and has a DataGridPro component. We need the checkbox selection to work a bit differently from what's implemented.
As per this example, selectionModel is an array that contains the ID of every selected row. We need to work with an exclusion list and a selection list:
Is it possible to change the way checkbox selection works on DataGridPro this much? Also, is it possible to detect a click on the "select all" checkbox in the setSelectionModel method?
Thanks in advance for any suggestions.
As you mentioned, controlled selection allows you to completely customize which row is selected. Then it is up to you to define the logic.
To detect when the "select all" checkbox is clicked, you can use headerSelectionCheckboxChange event (doc)