Control.DataBindings

I've never really had a use for DataBinding to Field values to Controls, but now that I am, I have a question.

When you add a Binding to the DataBindings Property of a Control, say the Text Property of a TextBox, it nicely displays the value for you...cool.  When I change the Text Property of that TextBox though, the underlying Field in my DataTable doesn't change, even though it's still DataBound.  Why is that   Is that by design   If so, is single DataBinding only for displaying data and that's it   Is there a way to have it automatically change the underlying value


Answer this question

Control.DataBindings

  • Kai Fransson

    I was pretty sure I tried EndCurrentEdit...I'll try again...
  • Mo Han

    I'm not sure I'm following the details here, but the value in the DataTable won't change until you commit the row in the CurrencyManager either by moving to a new row, or calling the EndCurrentEdit method of the CurrencyManager. The data should then be written back to the DataTable (but not to the data source--that requires an explicit call to a DataAdapter's Update command or calling a SQL Update or something like that).

    Could this be the problem  I've not seen a situation where data from a bound text box doesn't go back to the associated row in the DataTable.

  • Control.DataBindings