K
KlaasIMN
Using a combobox I want to retrieve the index of a given value in a
combobox.
object sel = combo.SelectedValue;
string selectedvalue = sel.ToString();
ComboBox.ObjectCollection items = combo.Items;
int i = items.IndexOf(sel);
returns -1 into despite the fact that [sel] does exist in the
combobox.
What is the problem here ?
Thanks.
combobox.
object sel = combo.SelectedValue;
string selectedvalue = sel.ToString();
ComboBox.ObjectCollection items = combo.Items;
int i = items.IndexOf(sel);
returns -1 into despite the fact that [sel] does exist in the
combobox.
What is the problem here ?
Thanks.