RadGridView bound to QueryableCollectionView not updating column filters (MVVM)

2 posts, 0 answers
  1. Ollie
    Ollie avatar
    19 posts
    Member since:
    Jun 2012

    Posted 07 Apr 2014 Link to this post

    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
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Apr 2014 Link to this post

    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.

     
Back to Top