Data bound combo box problem

  • Thread starter Thread starter J L
  • Start date Start date
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
 
John,

Will you be so kind not to multipost, I don't know if forte has the
possibility for that, however crossposting to relevant newsgroups is by some
of the regulars very much appreciated way for the dotNet and Foxpro
newsgroups.

Crossposting is sending more messages to more addresses at ones.

I gave a possible answer in another newsgroup.

Cor
 
Hi Cor,
I do understand not to cross post and usually do not. In this case I
did not know if it was an ADO.Net type question or VB in general. So I
tried both. Sorry.

John
 
Back
Top