Article ID: 327244 - Last Review: January 12, 2006 - Revision: 3.0 BUG: ComboBox does not clear when you set SelectedIndex to -1This article was previously published under Q327244 On This PageSYMPTOMS
When you set the SelectedIndex property of a data-bound Windows Forms ComboBox control equal to -1, the selected item does not clear from the ComboBox. When the value of -1 is assigned to the property for the first time, the first item at index 0 (zero) is selected in the ComboBox. When the value of -1 is assigned to the property for the second time, this assignment causes the ComboBox to clear. CAUSE
When you assign -1 to the SelectedIndex property of the ComboBox for the first time, this causes the item at index 0 to be selected. If the item at index 0 is already selected, the ComboBox clears.
RESOLUTION
To work around this issue, use one of the following methods:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONSteps to reproduce the behavior
| Article Translations
|

Back to the top
