Hi folks,
I am trying to bind a single combo box to a dataview derived from a table of US and Canadian states and Provinces. Column 0 is the abbreviation ('NC') and Column 1 is the name ('North Carolina'). I want the combo to show state names and store state abbreviations.
When I set the combo's DisplayMember to be the StateAbbreviation and the ValueMember to the StateAbbreviation, it works, giving me a list of abbreviations.
When I set the DisplayMember to the StateAbbreviation and the ValueMember to the StateName, I get a blank combo. When I set both to the StateName, I also get a blank combo. What is going on here?
Here's the code:
dvwData = New DataView(dstData.Tables(0))
ComboBox1.DataSource = dvwData
ComboBox1.DisplayMember = ("StateName"
ComboBox1.ValueMember = ("StateAbbreviation"
ComboBox1.Refresh()
Any suggestions are appreciated.
Brian
I am trying to bind a single combo box to a dataview derived from a table of US and Canadian states and Provinces. Column 0 is the abbreviation ('NC') and Column 1 is the name ('North Carolina'). I want the combo to show state names and store state abbreviations.
When I set the combo's DisplayMember to be the StateAbbreviation and the ValueMember to the StateAbbreviation, it works, giving me a list of abbreviations.
When I set the DisplayMember to the StateAbbreviation and the ValueMember to the StateName, I get a blank combo. When I set both to the StateName, I also get a blank combo. What is going on here?
Here's the code:
dvwData = New DataView(dstData.Tables(0))
ComboBox1.DataSource = dvwData
ComboBox1.DisplayMember = ("StateName"
ComboBox1.ValueMember = ("StateAbbreviation"
ComboBox1.Refresh()
Any suggestions are appreciated.
Brian