I'm currently so frustrated and can't seem to find a solution on google or msdn.
I'm using EF classes. In my code, I have a ObservableCollection (CustomerCollection) which is assigned to a CollectionViewSource. The data load/save fine. The problem is when I delete one of the customers in the datacontext, the listview
does not remove it. Can someone tell me how to fix this? Do I have to use the collectionview to delete/add all the times?
private DataContext db = new DataContext();
private CustomerCollection CustomerData;
private ListCollectionView customerView;
private void Window_Loaded(object sender, RoutedEventArgs e)
var query = from c in this.db.Customers
var customerSource = ((CollectionViewSource)(this.FindResource("CustomerSource")));
this.CustomerData = new CustomerCollection(query, this.db);
customerSource.Source = this.CustomerData;
this.customerView = ((ListCollectionView)(customerSource.View));
View Complete Post