How can I get a value to show in a combobox.dropdownlist?
Posted on 2008-10-11
I have a combobox with DropdownStyle=DropdownList but when I set the SelectedIndex to a value programmatically it does not show up on the combobox. The combobox always shows blank as if nothing was selected until I manually select something from the dropdown list. In which case it shows the value selected.
I have been through the code in debug both before and after the combo box has displayed and the SelectedIndex for the combo box is set correctly - yet it refuses to display the text associated with the selection.
Before the combobox was set to be DropDown and I had no problem getting it to display the initial value.
Is there a way around this? Or, do I have to set some flag to get it to display a programmatically set value?