J
J L
I have a combo box with DropDownStyle set to DropDownList. I bind it
as follows:
cmboOperators.DataSource = opTable
cmboOperators.DisplayMember = "OperatorName"
cmboOperators.ValueMember = "OperatorID"
opTable is a DataTable.
I have a button on the form (just for testing) that does this:
cmboOperators.SelectedIndex = -1
I expected the combo box to be empty but the first time I click the
button, it points to the first item in the combo box. The second time
I click the button, the combo box is empty.
Please advise what is going on or what I may have done wrong...
TIA
John
as follows:
cmboOperators.DataSource = opTable
cmboOperators.DisplayMember = "OperatorName"
cmboOperators.ValueMember = "OperatorID"
opTable is a DataTable.
I have a button on the form (just for testing) that does this:
cmboOperators.SelectedIndex = -1
I expected the combo box to be empty but the first time I click the
button, it points to the first item in the combo box. The second time
I click the button, the combo box is empty.
Please advise what is going on or what I may have done wrong...
TIA
John