Text Box Data Binding Not Always Updating

  • Thread starter Thread starter Barry Gast
  • Start date Start date
B

Barry Gast

Hi. I seem to be running into a problem with binding the text property of a
text box to a column in a data table. When the user updates the text in the
text box through the interface (form), the underlying data table is updated.
However, when, in code, the text property of the text box is assigned a new
value, the underlying data table is not updated. Is this by design or is
this a bug? Or am I missing something?

Code:

TextBox1.DataBindings.Add(New Binding("Text", MyClass.DataTable1,
"MESSAGE_TEXT")

' assigning this value does not update the DataTable1 data table.
TextBox1.Text = "New Message Text"

MyClass contains a data table member, DataTable1, that has a field
MESSAGE_TEXT.

Thanks.

-Barry Gast
 
* "Barry Gast said:
text box to a column in a data table. When the user updates the text in the
text box through the interface (form), the underlying data table is updated.
However, when, in code, the text property of the text box is assigned a new
value, the underlying data table is not updated. Is this by design or is
this a bug? Or am I missing something?

Code:

TextBox1.DataBindings.Add(New Binding("Text", MyClass.DataTable1,
"MESSAGE_TEXT")

' assigning this value does not update the DataTable1 data table.
TextBox1.Text = "New Message Text"

MyClass contains a data table member, DataTable1, that has a field
MESSAGE_TEXT.

If you don't get an answer here, feel free to post to this group:

<
 
Back
Top