Select Rows by condition with paging

Hello,

How do I select all rows have column 'MyStatus' = 'X'? I can use SfGrid.SelectRows but not in paging mode, I only can select rows in current view, not in another pages.

SfGrid 18.1.0.53, I tried a 18.3.0.48 has the same issue.

Thanks

5 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team November 18, 2020 01:55 PM UTC

Hi Nigel, 

Greetings from Syncfusion support. 

We have validated your query and we suggest you to refer the below documentation for your reference. 


Please get back to us if you have any queries. 

Regards, 
Jeevakanth SP. 



NI Nigel November 19, 2020 01:46 AM UTC

Hello,

As I said, the example works for current view (current page) only, there is now way to select rows in another pages.


JP Jeevakanth Palaniappan Syncfusion Team November 20, 2020 03:30 AM UTC

Hi Nigel, 

We have checked the issue with the same documentation code but unfortunately we are unable to reproduce the reported problem from our end. We have attached the sample and the video demonstration for your reference.  



If you are still facing the reported problem then please share us the issue reproducing sample or reproduce the issue in the provided sample which will be helpful for us to validate the issue and provide you with a better solution as early as possible. 

Regards, 
Jeevakanth SP. 



NI Nigel November 20, 2020 06:56 AM UTC

Hi J, Thank you for your response. I've modified your sample as my requirements. User click a button to select all rows match conditions. It's only work for current page.

Edit: 

Line 49:

var Source = await Grid.GetCurrentViewRecords();  --> give the same result.


Attachment: FetchData_af48e3ea.zip


JP Jeevakanth Palaniappan Syncfusion Team November 25, 2020 10:42 AM UTC

Hi Nigel, 

We have checked the provided code and found that you have selected the records in button click after the initial rendering. We would like to inform you that when paging is enabled in grid then grid will be rendered in load on demand concept in which only the current page rows will be generated in the grid. So GetSelectedRecords will only have the current page selected records. 

We suggest you to select the next page records in the databound event so that the records will be selected on its rendering. This behavior is documented in the below link 

As per your sample if you want to show the records in the UI then we suggest you to add the records containing “ALFKI” in a separate list by using the datasource. We have modified your sample for your reference. 


Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Marked as answer
Loader.
Up arrow icon