Greetings,
I have a combo box that I binded to a data set using text and tags. I
want it to display the DRT.Name property and have a DRT.UnitId as a
value.
this.drtComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("Tag", this.drtDataSet1, "DRT.UnitId"));
this.drtComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.drtDataSet1, "DRT.Name"));
What I would like to do now is also bind a label with the same Tag
propertie and have it change automatically when the combobox is
changed. I want the tag to be binded to the same DRT.UnitID as the
combobox and have that ID updated when the combobox changes. I would
then like to use that ID to display any other value in the dataset
matching that ID number. In this case displaying the DRT.SerialNumber
value.
this.snValueLabel.DataBindings.Add(new
System.Windows.Forms.Binding("Tag", this.drtDataSet1, "DRT.UnitId"));
this.snValueLabel.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.drtDataSet1,
"DRT.SerialNumber"));
However, the text of the label never changes when the combobox is
changed. Is their a way to make this work?
I can get it to work by detecting a change in the combo box and then
grabing the value ( ID value) and doing a query using that ID for any
other property matching that ID number.
Is this the easiest way of doing this??
Thank you