SelectedItem/SelectedIndex in DropDown ComboBox

SelectedItem/SelectedIndex in DropDown ComboBox

Post by O.B. » Sat, 09 Feb 2008 08:34:09


I have a ComboBox as a DropDown list. The following code is executed
in the form's constructor.

dropDownComboBox.Items.Add("ALL");

The following does nothing.

dropDownComboBox.SelectedItem = 0;

The following also does nothing.

dropDownComboBox.SelectedIndex = 0;

Help?
 
 
 

SelectedItem/SelectedIndex in DropDown ComboBox

Post by Misbah Are » Sat, 09 Feb 2008 10:39:47

try
dropDownComboBox.ClearSelection();
dropDownComboBox.Items[0].Selected = true;