Data Binding issue

  • Thread starter Thread starter Hollywood
  • Start date Start date
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!!
 
Could you please post a sample application that demonstrates the issue?

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Hollywood" <[email protected]>
| Subject: Data Binding issue
| Date: Fri, 10 Oct 2003 13:36:57 -0500
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: adsl-68-22-127-62.dsl.chcgil.ameritech.net 68.22.127.62
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:35707
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| 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!!
|
|
|
 
Back
Top