How to Unselect/ deselect all rows in a React AGGrid grid or reload the grid easily?

26 Views Asked by At

I have a React AGGrid grid with some rows and i can select a row/rows by clicking on a checkbox in a row. Anyway I need to deselect all checkbox/ checkboxes selected in rows when clicking on a button. How do I do this? Please help.

I tried this by using a setState and it didnt work. Please help.

1

There are 1 best solutions below

0
nd10 On

Well its pretty straightforward. You can define couple of methods such as these:

selectAllRows() {
  this.gridApi. selectAll();
}

deselectAllRows() {
  this.gridApi. selectAll();
}

and bind them to the buttons.

You can refer other options here: Ag Grid React: Selection Events