views:

10

answers:

0

B"H

I was wondering if there is any simple way to represent an EntityCollection (from a navigation property) in a WPF DataGrid.

Specifically the issue is with deleting items.

Displaying, Updating and even Adding items works fine. However the EntityCollection's Remove function only deletes the relationship, not the object. So when the user deletes an item from the DataGrid, the item disappears but when you go to save changes you get an exception because you now have an object that violates a referential constraint.

I am looking specifically for a no CodeBehind solution.