This code worked in SL3, but now i am getting error.
My sequence is:
grid.BeginInsert();
grid.IsEnabled = false; //i only want, that grid show me new row, but i want to edit in custom form.
//some editing in custom form and then button click.
grid.IsEnabled = true;
grid.CommitEdit();
MyDomainContext.SubmitChanges();
Here i get error:
Entity 'Groups : -1' is currently being edited and has uncommitted changes. A call to BeginEdit must be followed by a call to EndEdit or CancelEdit before changes can be submitted.
I try not to set IsEnabled to false and everything works. But i don't want to user allowed to edit in grid. I want that only new row is showned. I get this kind ob behaviour with setting grid enabled to false.
Callstack:
at System.ServiceModel.DomainServices.Client.DomainContext.ValidateChangeset(EntityChangeSet changeSet)
at System.ServiceModel.DomainServices.Client.DomainContext.SubmitChanges(Action`1 callback, Object userState)
at System.ServiceModel.DomainServices.Client.DomainContext.SubmitChanges()
at Urnik.Tables.SifrantPage.buttonPostClick(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
My sequence is:
grid.BeginInsert();
grid.IsEnabled = false; //i only want, that grid show me new row, but i want to edit in custom form.
//some editing in custom form and then button click.
grid.IsEnabled = true;
grid.CommitEdit();
MyDomainContext.SubmitChanges();
Here i get error:
Entity 'Groups : -1' is currently being edited and has uncommitted changes. A call to BeginEdit must be followed by a call to EndEdit or CancelEdit before changes can be submitted.
I try not to set IsEnabled to false and everything works. But i don't want to user allowed to edit in grid. I want that only new row is showned. I get this kind ob behaviour with setting grid enabled to false.
Callstack:
at System.ServiceModel.DomainServices.Client.DomainContext.ValidateChangeset(EntityChangeSet changeSet)
at System.ServiceModel.DomainServices.Client.DomainContext.SubmitChanges(Action`1 callback, Object userState)
at System.ServiceModel.DomainServices.Client.DomainContext.SubmitChanges()
at Urnik.Tables.SifrantPage.buttonPostClick(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)