Combobox not display selected item

  • Thread starter Thread starter Mark Boettcher
  • Start date Start date
M

Mark Boettcher

I am writing a Windows Form app in c# and I've populated a combobox with
values.

I click on the down arrow to display the list and the list of values
displays correctly. Once I select a value, the list disappears and the
selected value does NOT display as the selected item. If I click the down
arrow again and re-select the value, this time it displays.

What's wrong?

Thanks,
Mark
 
Check your code. Somewhere, you must have "Combobox1.SelectedIndex =
-1". There is really no other way for this to happen.

One way to check is to capture the event "SelectedIndexChanged" and
then set a break point there to see how the event is being fired.

Dom
 
Hi,

Check your code, see what methods are handling the selenctedindexchanged.
Also verify what you do ni that method, if you affect other controls's
status it's possible that the handlers of those other controls do the same
with the combo.
 
I found my problem - in the course of executing the SelectedItemChanged event
I was clearing the combobox value list with .Items.Clear.

Txs,
Mark
 
Back
Top