Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: Filtered ObservableCollection Does Not Stay In Sync With DbContext [1572]

$
0
0
With entities typed as ObservableListSource (as per the Winforms Databinding guidance), a Windows Forms BindingSource bound to DbContext.EntityTypes.Local.ToBindingList, the BindingSource.SupportsFiltering property is False.

So I attempted to filter the ObservableCollection, using C# examples that I converted to VB.Net. I eventually managed to get the collection filtered but the DbContext.Local collection was not updated when adding, deleting and updating entities in the grids, as evidenced by a return of 0 when attempting a DbContext.SaveChanges.

The filtering scheme I found requires the creation of a New ObservableCollection, which seems to break all synchronization between DbContext and the 'Master' grid's BindingSource.



Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>