471,337 Members | 1,034 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

data binding: using text and tags.

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

Dec 14 '05 #1
0 1439

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by pmud | last post: by
16 posts views Thread by D Witherspoon | last post: by
19 posts views Thread by Simon Verona | last post: by
2 posts views Thread by Matthias | last post: by
9 posts views Thread by Anil Gupte | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.