WINDOWS FORMS
I have a form with a BindingSource connected to an Object.
The controls on the form are bound to the properties of the Object.
I have a text box txtOtherVoltage where the Text property is bound to
the VehicleVoltageUsage property of my object.
When I load the form, the txtOtherVoltage text box shows the correct
data from the object.
However, I want to be able to change the value of the text box
programmatically and have it saved into my object (which is later
serialized in XML)
If I run this code:
this.txtOtherVoltage.Text = "12";
the value of the corresponding property in the object is NOT updated.
However, if I do this:
m_data.VehicleVoltageUsage = 12;
(with m_data being my current instance of the object) all is well.
Which rather negates the point of data binding, non? So what am I
doing wrong? I have a sneaking suspicion that it's something to do
with the property being of type int, and the text box having a string
written to it. However, I am very new to C# and I might be totally
off the mark. Other controls on the form (including a DataGrid,
CheckBox etc.) all work fine.
TIA
Edward