Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store hand-typed combobox values
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How to store hand-typed combobox values
Miscellaneous
Thread ID:
00813616
Message ID:
00813616
Views:
37
I have a combobox bound to a dataset field, with a rowsource set to an arraylist of objects containing state abbreviations. The dropdownstyle property set to "Dropdown" so I can type in a value in the textbox area.

When I select an item from the Dropdown list my data can be saved to the dataset and works as expected. But when I hand-type a value (even if it matches an item in the dropdown list) nothing is changed when I save the dataset.

Can someone see what I am missing in the following code? What do I need to change for hand-typed entries in the combobox

******************************
With Me.cboStates
.DataBindings.Clear()
.DataSource = States ' States is an arraylist
.ValueMember = "ShortName" ' A property of arraylist objects

.DisplayMember = dsCompanyInfo.Tables("CompanyInfo").Rows(0).Item("State")
.DataBindings.Add("SelectedValue", dsCompanyInfo.Tables("CompanyInfo"), "State")
End With
******************************
Next
Reply
Map
View

Click here to load this message in the networking platform