Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Updating filter on ICollectionView in ViewModel
posted

Hello!

I have a ViewModel that contains an ObservableCollection of items, an ICollectionView for the ObservableCollection, and a xamdatagrid's datasource bound to the ICollectionView, IsSynchronizedWithCurrentItem is true. Filtering is enabled on the xamdatagrid.

  1. ObservableCollection is populated with items via service call.
  2. xamdatagrid updates with records, displaying the items.
  3. User applies a filter to a column, reducing the number of visible records.
  4. ViewModel performs ICollection.MoveCurrentToFirst().
  5. The first item is selected from the ICollectionView, as the collection view has not had the same filters applied to it as are applied to the xamdatagrid.
  6. Other controls update from the current item in the ICollectionView, out of sync with the xamdatagrid.

What I would expect to happen is that the filters applied to the xamdatagrid also filter the bound ICollectionView such that MoveCurrentTo() calls on the ICollectionView will respect the filters apparent in the grid.

 

Thank you for any help you can give!