General information
Title:
How to store hand-typed combobox values
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only