Hello Renjith
Thanks for the feedback. I have modified and attached your sample project to demonstrate the problems I am having as requested. Details of how to recreate the issues are as below
Query 1 (above) > Thank you
Query 2 (above) > Goto Page Persist 01 > Type "Task 41" in Task filter field and hit enter > Press Save Persist > Clear filter term from Task field and hit enter > Press Apply Persists > the filter works, but the filter field is not populated
Query 2.1 (new) > Goto Page Persist 01 > Change size of Description column > Press Reset Persist > fails to reset (problem with this column only)
Query 3 (above) > Goto Page Persist 01 > Click on the Transaction Date Filter and set a date range > Save Persists > change the date range filter > Apply Persist > Filter is not reset (as noted I understand if this is a limitation)
Query 4 (above):
The following is all demonstrated on Page Persist 02
As you suggest I am using the Destroyed Event to capture the persist data. I then reload this persist data when the page is opened again. I used the Grid Created Event for this. The problem is (I think) that the data is not always properly captured during the Destroyed Event leading to an error on the subsequent Created event. To demonstrate this please do the following:
- Go to Persists 02 page (you will see a notification that the persist data has been applied)
- Go back to the home page (you will see a notification that the persist data has been saved)
- Go back to Page 02 and sometimes you will get an error (see screen shot below)
Note you will not always get this error. If you do not see the error then please stop the project, restart and try again. I can create this error reasonably reliably.
So I think the problem is in saving the persist data in the Destroyed event when leaving the page. When this does work it seems to work for all (sort, search, column chooser, column width, column position). It does not work for filtering however.
I have tried using the ActionComplete event instead of the Destroyed event to store persist data after every change by the user. You will see it commented out in the code. But this too has problems:
- Again the filtering is not persisted
- A column size change is not captured by this event. I tried using ResizeStopped event to handle this, but this is too chatty / does not capture persist data correctly
My preference is to use the Destroyed event if it can be made reliable (it seems like the right place to capture the data) and the issue with the not capturing filtering can be resolved.
Many thanks
Looking forward to hearing from you.
Attachment:
BlazorApp1_f8ec512.zip