binding problem

I

Ivan

Dear ALL,

Does anyone know why binding a class property to a textbox will not always working properly??
My program is now having 10 textbox and all textbox bind to corresponding object property.
Some of the textbox has set as readonly ...
The problem is the value of some object property will not update if the textbox value was changed.

eg.1
txtName.Databindings.Add("Text", objVendor, "Name")
txtName.Text = "Hello"
Result ==> Msgbox(objVendor.Name) <> "Hello"

eg.2
txtName.Databindings.Add("Text", objVendor, "Name")
' txtName.Text is changed by user input
Result ==> Msgbox(objVendor.Name) <> "Hello"

Does anyone know what should i do to make sure bindings correctly??... Thank you!!

Ivan
 
K

Ken Tucker [MVP]

Hi,

Your class should contain Implements IEditableObject.
http://msdn.microsoft.com/library/d...emcomponentmodelieditableobjectclasstopic.asp

Ken
Dear ALL,

Does anyone know why binding a class property to a textbox will not always working properly??
My program is now having 10 textbox and all textbox bind to corresponding object property.
Some of the textbox has set as readonly ...
The problem is the value of some object property will not update if the textbox value was changed.

eg.1
txtName.Databindings.Add("Text", objVendor, "Name")
txtName.Text = "Hello"
Result ==> Msgbox(objVendor.Name) <> "Hello"

eg.2
txtName.Databindings.Add("Text", objVendor, "Name")
' txtName.Text is changed by user input
Result ==> Msgbox(objVendor.Name) <> "Hello"

Does anyone know what should i do to make sure bindings correctly??... Thank you!!

Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top