I have attempted to use various techniques to remove items from the IEditableCollectionView DataView interface but no matter what removed items just reappear after the call to Submit changes. For example if you do the following:
At first the DataGrid will look correct, however if you call Source.Load the removed entities again appear in the DataView even though they no longer exist in the database. Another way to repro is as simple as adding a DataPager to the mix and calling the
above code. If you then move to the next page and then back to the original page the DataGrid will contain the removed entries yet again but at the bottom of the list. It's almost as if the DataView is arbitrarily adding a RemovedItems collection contents
to the bottom of the DataGrid no matter what you do.
nlecren
Member
5 Points
9 Posts
Re: DomainDataSource deleting data
Jul 24, 2009 04:00 PM | LINK
Jeff,
I have attempted to use various techniques to remove items from the IEditableCollectionView DataView interface but no matter what removed items just reappear after the call to Submit changes. For example if you do the following:
((IEditableCollectionView)Source.DataView).Remove(customer);
((IEditableCollectionView)Source.DataView).CommitEdit();
Source.SubmitChanges();
At first the DataGrid will look correct, however if you call Source.Load the removed entities again appear in the DataView even though they no longer exist in the database. Another way to repro is as simple as adding a DataPager to the mix and calling the above code. If you then move to the next page and then back to the original page the DataGrid will contain the removed entries yet again but at the bottom of the list. It's almost as if the DataView is arbitrarily adding a RemovedItems collection contents to the bottom of the DataGrid no matter what you do.
Hope this helps
Thanks
Nick