I am having trouble adding an Entity Framework entity to an ObjectContext EntitySet automatically using the DataGrid WPF 4.0 add functionality. Here's the setting:
DataGrid → BoundTo → ListCollectionView → BoundTo → EntitySet
When I interactively add a row to a DataGrid, EntitySet does not add a new entity. However, updating row cell data actually updates the properties of related objects.
Any idea what I can do wrong?
Here is the XAML for the ListCollectionView:
<CollectionViewSource x:Key="FieldList" Source="{Binding DB.Fields}" CollectionViewType="{x:Type data:ListCollectionView}"> <CollectionViewSource.SortDescriptions> <ComponentModel:SortDescription PropertyName="Name" /> </CollectionViewSource.SortDescriptions> </CollectionViewSource>
wpf entity-framework wpfdatagrid
Mike gates
source share