How to get all selected records from a grid even if I change the page.

Hello,

I need to get all selected records (checked form checkboxes) from a grid even if I change the page.

If I go to next page the records selected in previous page it's lost.

How can I achieve this?

I try with this but the behaviour is as I described above.

let selectedRecords = this.grid.getSelectedRecords();

Thank you in advance!


3 Replies

SK Sujith Kumar Rajkumar Syncfusion Team March 3, 2022 07:45 AM UTC

Hi Dana, 
 
Greetings from Syncfusion support. 
 
Your requirement of persisting selected records across pages can be achieved by enabling the persistSelection property of the Grid’s selectionSettings. For persisting selection on the Grid, any one of the column should be defined as a primary key using columns.isPrimaryKey property and a checkbox type column needs to be defined. 
 
We have prepared to demonstrate this case for your reference. You can find it below, 
 
 
More details on this can be checked in the below documentation link, 
 
 
With this enabled, you can retrieve the selected records across the pages. 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 



DS Dana Sarghe March 3, 2022 01:59 PM UTC

Thank you!

It works just fine!



SK Sujith Kumar Rajkumar Syncfusion Team March 4, 2022 06:57 AM UTC

Hi Dana, 

You’re welcome. We are glad to hear that your query has been resolved. 

Regards, 
Sujith R 


Loader.
Up arrow icon