I have following problem. I have typical master/detail UI scenario. I set main object (CommissionPlan) as a DataContext. Then I bind grid to CommissionPlanItems (this is collection of child items)
Everything works great on additions/updates. When I try to delete existing row - I get following EF error: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.
I found bunch of recepies on how to handle this. But I'm not sure how to do it in my case since deletion happens auto-magically, via deleting row from a grid. What should I modify in this case?