DataObjectBase IEditable.BeginEdit

Topics: Feature requests
Jun 18, 2012 at 5:31 PM

Hi Geert,

i stumbled about this issue when binding to telerik controls.

i always get the InvalidOperationException "BeginEdit cannot be invoked twice. A call to BeginEdit must always be closed with a call to CancelEdit or EndEdit."

because the controls are subsequent calling BeginEdit.

MSDN says the following (default/standard behavior):

"If BeginEdit is called on an object that is already beeing edited, the second and subsequent calls are ignored."

http://msdn.microsoft.com/en-us/library/system.componentmodel.ieditableobject.beginedit.aspx

Would it be possible to adjust the DataObjectBase to this default behavior?

A simple quick fix would be to override the following method:

        protected override void OnBeginEdit(System.ComponentModel.BeginEditEventArgs e)
        {
            e.IgnoreDoubleCall = true;
            base.OnBeginEdit(e);
        }

Many Thanks!
Coordinator
Jun 18, 2012 at 5:33 PM

Yep, sounds fair.

Coordinator
Jun 18, 2012 at 5:45 PM

Done.

Jun 18, 2012 at 6:59 PM

Thanks a lot for this fast fix :-)