Hello,
I have a XamDataGrid bound to an ListCollectionView (which has an underlying CollectionViewSource that is referencing an ObservableCollection).
When I add an item and update the ObservableCollection then the last added item is duplicated in the visual display.
Adding a second item will remove the duplicate but add a duplicated of the second item.
I have attached a sample project that shows the issue.
In "ItemListViewModel.cs" when I comment the row 44, then the issue disappears.
Thanks in advice.
WpfApp1_gridDuplicates.zip
Thank you for sharing your sample for the investigation, so i debug the code and looks like a timing issue, your filter been applied too early that litemlist view is not yet updated, so when i put the filter in beginInvoke its working fine .
So your code would be :
Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => { ItemListView.Filter = o => ItemListViewFilter((DataItem)o); }));