Hello Community.

Situation : (var names simplified for ease of example)


1. I have a Combobox control bound to a table in SQL2005.

2. The Table is two columns "name" and "id"
Table example
id......Name
118...Jhon
321...Doe
ect.. (sorry for the basic description just trying to give as much info)

3. In the combobox properties i have the following setings.

DataSource = (my databound table source)
Displaymember = name
Valuemember = id

Ex:
VB Code:
  1. cboUserList.SelectedValue = mySqlReader.GetInt32(7)
The Sql query retrives and integer that sets the item in the combobox to the value member accordingly. This all works perfect. The index of the combo box is not used because the values in the table are dynamic thus the use of an ID in the users table.

MY PROBLEM:

I wish to set a textbox to the displayed value of the combobox.

VB Code:
  1. txtUserNon.Text = cboUserList.SelectedText

This seems not to work. I have tried all of the methods associated with comboboxes such as SelectedValue,Item, and text and they return the ValueMember?!..not the Shown text such as "Jhon" or "Doe"

For example the end result is to have the (databound)combobox displaying the username and the text box next to it displaying the same name.

I am pretty sure this problem does not exsist if i was using a dataset with a dataview. Thus the item value would be easy to copy, but the attempt here is to learn how to do what im asking to do with control bound data.

Hope thats enough info. Thanx!..