I am filling a combo box at runtime with a dataset populated from a query to a sql server and set my properties as detailed below in the code snipet. I want to use the SelectedIndex value to determine if the user has actually made a selection or not.
It's strange. When I click in the dropdown arrow, press a letter to navigate, and then tab to select an entry in the list; ...when referrencing the SelectedIndex value it remains -1.
How can I get the index to change when the value is changed in the manner described above? If clicking an item in the list with the mouse however it does change.
.DataSource = ds.Tables("inventory")
.DisplayMember = "inventory_item"
.SelectedItem = Nothing