Tab Control with Combo Box

D

Don

I have a windows form that contains a tab control. On
one of the tabs I have a combo box bound to a datatable.
When I first enter the tab I initialize the selectedindex
of the combobox to -1. I then type text into the combo
box that does not match any entries in the dropdown
list. If I then choose a different tab and return to my
tab with the combo box, the selectedindex has been
changed to 0 and the text I entered is replaced with the
text from list item 0. Why does the combo box not retain
a selectedindex of -1 with the text I entered? How can I
correct this?

Thank You,
Don
 
H

Herfried K. Wagner [MVP]

Hello,

Don said:
I have a windows form that contains a tab control. On
one of the tabs I have a combo box bound to a datatable.
When I first enter the tab I initialize the selectedindex
of the combobox to -1. I then type text into the combo
box that does not match any entries in the dropdown
list. If I then choose a different tab and return to my
tab with the combo box, the selectedindex has been
changed to 0 and the text I entered is replaced with the
text from list item 0. Why does the combo box not retain
a selectedindex of -1 with the text I entered? How can I
correct this?

I have already heard about that bug (you are not the only one who
experiences it). I feel sorry, but I don't know a "fix".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top