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

RadGridView bound to QueryableCollectionView not updating column filters (MVVM)

1 Answer 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ollie
Top achievements
Rank 1
Ollie asked on 07 Apr 2014, 10:00 AM
I have a RadGridView bound via the ItemsSource property to an QueryableCollectionView which is exposed as an IEnumerable property in a ViewModel. This ViewModel is the contents of a TabControl (RadTabControl).

The tab contorl does not persist the visual tree when the tabs are changed (as expected), but because I'm using QueryableCollectionView the view state of the grid is persisted.

When I go back to the original tab any filtering is reapplied as expected (great!) but the the inidividual column filters haven't been updated - the filter icon in the column header has not changed colour and importantly the column filters UI does not show all filtering possiblities.

Can some explain how I can get the grid to display correctly when it is re-bound to a QueryableCollectionView which has FilterDescriptors already defined?


Cheers

Ollie Riches

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 10 Apr 2014, 08:17 AM
Hi,

The reason for this behavior is that you rely on QueryableCollectionView.FilterDescriptors collection. They are indeed synchronized with the FilterDescriptors of RadGridView and the items are filtered out correctly.

On the other hand the visual representation of the filtering in RadGridView is done through IColumnFilterDescriptors, specific to each column.

You can check the "GridView Serialization" example on the WPF Demos as a reference on how to persist different GridView's settings including the filters. You can then refer to Programmatic Filtering article where more details on applying filtering from code are explained. 

Let me know in case you have any additional questions.

Regards,
Didie
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Ollie
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or