This is a migrated thread and some comments may be shown as answers.

Filters on RadGridView removed after update ItemsSource

1 Answer 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 24 Aug 2020, 01:25 PM

Hi,

I have a RadGridView which is bind on the Items property from my ViewModel :

<telerik:RadGridView x:Name="gridView" 
                             Grid.Row="1" 
                             ItemsSource="{Binding Items}"
                             >

On many column, user can Filter, Sort, ...

<telerik:GridViewDataColumn Header="Nom" 
                                        IsGroupable="False" IsSortable="True" IsFilterable="True"
DataMemberBinding="{Binding Utilisateur.Nom, Mode=OneTime}"
                                        Width="150" MinWidth="10" />

Unfortunately, the filters are reset each time the Items property is modified (if the user reloads the data, modifies his search, ...).

Is there a way to prevent this reset of the filters on the columns?

Thx,

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 27 Aug 2020, 07:31 AM

Hello Julien,

Thank you for the shared code snippets. 

The described behavior is the expected one as when the ItemsSource of the control changes the filtering is cleared. There isn't an option to prevent this, however you can persist the filterdescriptors and apply them after that. You can take a look at the PersistenceFramework and the GridViewSerialization SDK example, which shows how to persist several RadGridView settings including the filtering. 

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
GridView
Asked by
Julien
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or