DataGrid filter values in ColumnCollection

I am using the RadzenDataGrid with the LoadData event to load data from the database. I have column filtering enabled and when a filter value is updated and the LoadData returns successful.

I am trying to implement persistence on the grid state when the user leaves the grid and comes back, they will have the same page number, sorting and filters as before they left.

The issue I am having is that the FilterValue property on the columns are set to null and not the value showing on the screen when I am enumerating through the ColumnsCollection. The columns are string values.

Is this a bug or am I approaching this the wrong way?

Hi @michaelgrissom,

Indeed the FilterValue isn't currently set. We will investigate if it is possible to support that scenario and post here our findings.

@korchev Is there another way to get the value out of the filter box for each column?

Currently you have only the Filter property of the LoadData event arguments. It however contains the filter in OData / Dynamic Linq compatible format.

Good Morning! I see a commit to your repo:

Sorts and Filters added to LoadDataArgs · radzenhq/radzen-blazor@8b156a8 · GitHub

Yes, this is how we decided to implement this feature. The event argument has new properties that contain the current filter and sort data. Would ship by the end of this week.

1 Like

Are you planning a release soon? Waiting on this functionality. Thanks!

We will release it tomorrow.

1 Like

Hi, can you please elaborate on persisting DataGrid state (page number, filter and sort order)?
What is the best way to store currently applied filter and restore it after re-initializing the component where RadzenDataGrid is placed?
How I approached this is to save filter (Filters collection property) in centralized state container and in the initial LoadData event I'm restoring the filter by setting FilterValue and FilterOperator for any column that is part of the filter. But this way it seems the applied filter can't be cleared by the Clear button (filter popup)...

That is the same way that I saved and restored the filter property state. I did not test the clear button on the filter, however if you delete the value in the filter textbox, the filter would be removed.

How do we use this new feature to retain the filters?

1 Like