for simplicity, I have an entity called Group
, which contains a list of child items called Item.
The Grid is bound to Group.Items, which is an EntityCollection.
I could easily achieve what I need, if the RadGridView_RowEditEnded
event returned e.EditOperationType
like I would expect, seeing as it was the insert
that was ended.
Note the unreachable code below.
private void RadGridView_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
if (e.EditOperationType == Telerik.Windows.Controls.GridView.GridViewEditOperationType.Insert)
if (e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Commit)
//add to context - not needed as the entity is already connected
// Model.InsertNewIntoContext(e.EditedItem as Item);
Model.RemoveFeild(e.EditedItem as Item); //unreachable code!