Deselect issue when naviagate in pages in Grid

Hi, 

Have a grid which gets data from my backend and has pagination. I have added a checkbox to the grid user can select multiple rows. When user select row(s) in page 1 and change the page to page 2, rows selected from page 1 will be removed from grid, when user gets back to page 1, row(s) are deselected. 

I have checked 

(grid as GridComponent).getSelectedRecords().length)

whenever user navigate to a different page, it shows 0


1 Reply

JS Johnson Soundararajan S Syncfusion Team April 18, 2024 02:47 PM UTC

Hi Hamidreza Shojaei,


We understand your query, you want to maintain checkbox selections even after changing the page. To achieve this, we recommend utilizing the selectionSettings.persistSelection property.


When maintaining a persistent selection on the grid, it is important to define one of the columns as a primary key.


Please refer to the below demo link and documentation for more information.


Demo link : Data Grid · Checkbox Selection · Syncfusion React UI Components


Documentation link: Check box selection in React Grid component | Syncfusion


Please get back to us, if you need further assistance.


Regards,

Johnson Soundararajan S


Loader.
Up arrow icon