views:

18

answers:

0

I'm trying to do a simple Databinding between a string property of an object instance, and a TextBox control. The string property has both get and set accessors, yet the source object does not implement INotifyProperty changed. This does not matter though as I'm not concerned with the object updating the text, but rather only changes to the textbox control updating the source object property.

Here's the code for the databinding:

notesTextBox.DataBindings.Add("Text", obj, "Remarks", false,DataSourceUpdateMode.OnValidation);

When this is executed the TextBox correctly displays the current value of the "Remarks" property of the source object. Yet if I try to change the text in the TextBox the property of the source object is never updated. I've set a break point at the beginning of its set accessor and it never ends up being hit.

I've tried this with out specifying the DataSourceUpdateMode, as well as setting it to DataSourceUpdateMode.OnNotifyPropertyChanged. I've also verified that noteTextBox.CausesValidation is true, and validating events are being fired.

The really strange thing is this was working, but now it's not. And I have no idea what I changed to break it. Anyone know why this databinding is not updating the source object when changes are made to the TextBox text?