combo box: Can I bind Text value to a column in my dataset?

Omid Golban

Member
Joined
Jun 3, 2003
Messages
6
I have setup my dataset & have finished binding a combo box to its values:
....
cboTest.DataSource = dsXref.Tables(0) Select CONO, NAME_1 from COMPANY
cboTest.DisplayMember = "NAME_1"
cboTest.ValueMember = "CONO"
....

Now, when I drop down the menu of combo box, I get a list of NAME_1 columns as expected.
After user chooses one of the entries, that entrys NAME_1s data is copied into combo boxs text property.
Instead I want the CONO (the value member) to be copied into the text property.
How can I do this?


Additionally, after using an entry from the dropdown menu of combo box (SelectedIndexChanged), I expected the Validating event to fire, but it doesnt. How can I find out the firing sequence of events?


Thank you,
Omid
 
In which event should I do this?

Ive tried Validating, SelectedIndexChanged, SelectedValueChanged, Validated, & SelectionChangeCommitted. In each instance, I did set the text value of the control & verified it by displaying it using MsgBox. But when the control goes back to the form, I end up with the value from NAME_1 column back in the controls Text.
 
Back
Top