How to retrieve persistence filters?

I have an sfGrid with persistence enabled.

I do some custom operations when filtering. for that I listen to OnActionBegin event.

When I reload the page, the persistence feature remembers my filters. All good so far.

My issue is that the persistence-remembered filters are applied to the grid without my custom actions being executed.

I would like to retrieve that information  so I can execute my custom code.

How can I get the filter values (column, filter type, filter body) for that?

I tried calling Grid.GetPersistData() at OnAfterRenderAsync(), but the method didn't return the the info I'm looking for.


1 Reply

MS Monisha Saravanan Syncfusion Team August 29, 2022 01:57 PM UTC

Hi Jose,


Greetings from Syncfusion support.


Query: “I tried calling Grid.GetPersistData() at OnAfterRenderAsync(), but the method didn't return the info I'm looking for.”


We have checked your query and prepared an sample as per your shared reference and GetPersistData returns the filtered columns. Kindly check the attached sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid1763248723.zip  


If we misunderstood your query or if you have further queries then kindly share the below details to validate the issue further at our end.


  1. Share us Grid code snippet along with model class.
  2. Share us whether you are trying to store the customized value in persisted data.
  3. Share us the video demonstration of the issue.
  4. If possible share us an simple issue reproduceable sample or reproduce the issue on the above mentioned sample.


The above-requested details will be helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Monisha

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Loader.
Up arrow icon