How should we restore the row state of the grid when a user navigates away and back again

Hello,

We are using a CustomDataAdaptor to fetch data from an API to display in the SfGrid which is working well. However, if the user navigates to another page in our application and then back again, we want to restore the state of the grid without making another API call. 

Setting EnablePersistence="true" seems to cater for most of the state of the grid but not the records themselves.

We can retain those records in memory or save to local storage by hooking into the DataBound event. However, I'm unclear how we should restore those records into the grid when the user comes back to the page containing the grid.

Could you please advise/provide an example of how to achieve this?

Thanks,

Chuck


1 Reply

MS Monisha Saravanan Syncfusion Team February 4, 2022 08:48 AM UTC

Hi Chuck, 
  
Greetings from Syncfusion support. 
  
We have anlayzed your query and we would like to inform that we will retain the Grid components state based on the performed data operations. Grid restores by considering the following settings like FilterSettings, SortSettings, PageSettings and GroupSettings. So the Grid will retain based on those settings and it is impossible for us to retain based on rows state. 
  
Kindly get back to us if we misunderstood your query or if you have further queries. 
  
Regards, 
Monisha 


Loader.
Up arrow icon