H
Hollywood
I have an issue with data binding IEditableObjects to controls in which when
a control is changed the IEditableObjects.BeginEdit, but not the
IEditableObjects.EndEdit is called. Additionally, when actually performing
the binding via the control.DataBinding.Add(), this calls the
IEditableObjects.BeginEdit method but never the EndEdit.
Essentially what I have is a DataObject : IEditableObjects class that
resides in a DataList : IBindingList class. The DataList class is bound to
various controls by control.DataBinding.Add(propertyName, DataList,
DataObject.dataMember) [or control.DataBinding.Add(new Binding(propertyName,
DataList, DataObject.dataMember))].
The only way to resolve the issue that I've found is to cycle through the
DataList and call IEditableObjects.CancelEdit on the objects in the list to
reset their internal edit flags after DataBinding the DataList. Then to
make sure that the IEditableObjects.EndEdit gets called after a bound
control's value is changed, is to have the LostFocus event execute the
EndEdit() on the selected member of the DataList.
Anyone seen this or have any thoughts? A sample application that
demonstrates the issue can be made available.
Thanks!!
a control is changed the IEditableObjects.BeginEdit, but not the
IEditableObjects.EndEdit is called. Additionally, when actually performing
the binding via the control.DataBinding.Add(), this calls the
IEditableObjects.BeginEdit method but never the EndEdit.
Essentially what I have is a DataObject : IEditableObjects class that
resides in a DataList : IBindingList class. The DataList class is bound to
various controls by control.DataBinding.Add(propertyName, DataList,
DataObject.dataMember) [or control.DataBinding.Add(new Binding(propertyName,
DataList, DataObject.dataMember))].
The only way to resolve the issue that I've found is to cycle through the
DataList and call IEditableObjects.CancelEdit on the objects in the list to
reset their internal edit flags after DataBinding the DataList. Then to
make sure that the IEditableObjects.EndEdit gets called after a bound
control's value is changed, is to have the LostFocus event execute the
EndEdit() on the selected member of the DataList.
Anyone seen this or have any thoughts? A sample application that
demonstrates the issue can be made available.
Thanks!!