Save the DataGrids Filter State

0 Answers 96 Views
DataGrid
Hans
Top achievements
Rank 1
Hans asked on 21 Jul 2023, 07:31 AM

Hi

I have a Datagrid and on double click on an row a detail view for this row is loaded. And when clicking the back button the datagrid view is loaded again. The Viewmodel behind the datagrid is a singleton, so the data is still there.

Now what I want is to preserve the filters of the grid so that a user can set a filter, double click an entry, click the back button and has the filter still set and the data still filtered.

Its a bit tricky but i can do that with Text- and DateTimeFilters by saving the Datagrids Filterdescriptors in the Viewmodel in the OnNavigatedFrom event and setting a cloned version of them in the OnNavigatedTo Event.

But I see no possibility for DistinctValueFilterDescriptors because the actual Data is set in the filter.

Is there a better way to save and load the filter state of a grid?

No answers yet. Maybe you can help?

Tags
DataGrid
Asked by
Hans
Top achievements
Rank 1
Share this question
or