Tom Knowlton
asked on
VB .NET: Programmatically set ComboBox selection
Suppose I have a combobox control in VB .NET that is assigned to a DataSource:
'ae.fnReturnAEList.Tables( 0) returns a DataSet object
ComboBoxAELookup.DataSourc e = ae.fnReturnAEList.Tables(0 )
Then the end-user types something in the ComboBox that is not in the list.
Since the value typed in is not in the list, an error results.
What I would like to do is default to the first item in the ComboBox (whatever that might be).
Thanks,
Tom
'ae.fnReturnAEList.Tables(
ComboBoxAELookup.DataSourc
Then the end-user types something in the ComboBox that is not in the list.
Since the value typed in is not in the list, an error results.
What I would like to do is default to the first item in the ComboBox (whatever that might be).
Thanks,
Tom
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am not sure if the business rules allow me to set the style to "DropDownList". I'll check on that.
For now I went with you second suggestion.
I actually found this on my own while waiting for a resonse, but it will be nice to have this question captured for future reference.
Thanks,
Tom
For now I went with you second suggestion.
I actually found this on my own while waiting for a resonse, but it will be nice to have this question captured for future reference.
Thanks,
Tom
ASKER
This would happen when the Focus leaves the ComboBox.