Multi-Talented Combobox

stevecking

Active member
Joined
Dec 27, 2006
Messages
32
Programming Experience
5-10
It's relatively easy to set up a combobox to use a lookup table and bind the 'SelectedValue' -- but, I would like to be able to have the combobox either use a selected value OR allow the user to freeform enter text into the combobox and store that value into the table. Obviously then the ValueMember and SelectedValue would conflict with my purpose of simply entering text. I've done this in Microsoft Access which contains a property to indicate whether the combobox should use either means of entry. I could use some help on this one, otherwise I add a button on the side of a textbox and use the DataTable and the textbox control as parameters to select a value from the combobox and store it as text in the textbox. It seems a roundabout way of doing things. Any assistance would be appreciated.
 
Just check the SelectedItem property. If it's Nothing then no item has been selected so you would use the contents of the Text property, otherwise use the SelectedValue.
 
Back
Top