R
Robert
I am trying to set a Combobox's SelectedItem property to an object but
without any success.
Code Example:
for (int i = 1; i < 10; i++)
{
Person p = new Person("JDoe" + i.ToString());
Combobox1.Items.Add(p);
}
Person findP = new Person ("JDoe5");
Combobox1.SelectedItem = findP;
The combobox does not set the SelectedItem when I run the above code.
Obviously I'm missing something and any help is appreciated.
without any success.
Code Example:
for (int i = 1; i < 10; i++)
{
Person p = new Person("JDoe" + i.ToString());
Combobox1.Items.Add(p);
}
Person findP = new Person ("JDoe5");
Combobox1.SelectedItem = findP;
The combobox does not set the SelectedItem when I run the above code.
Obviously I'm missing something and any help is appreciated.