R
Rod
I am trying to select a particular ComboBox item programmatically
immediately after setting the the DataSource of the ComboBox to an
ArrayList. But there are no Items in the ComboBox after setting the
DataSource so I am unable to select a particular item. What am I
missing?
Thanks,
Rod Early ([email protected])
My code is something like this:
public class ItemClass
{
private string _ID;
private string _Text;
public string ID...
public string Text...
public ItemClass(string ID, string Text)...
}
....
drop = new ComboBox();
drop.DisplayMember = "Text";
drop.ValueMember = "ID";
ArrayList aList = new ArrayList();
PopulateArrayList(aList);
drop.DataSource = aList;
// Would like to search for item to select here, but drop.Items.Count =
0 !!!
immediately after setting the the DataSource of the ComboBox to an
ArrayList. But there are no Items in the ComboBox after setting the
DataSource so I am unable to select a particular item. What am I
missing?
Thanks,
Rod Early ([email protected])
My code is something like this:
public class ItemClass
{
private string _ID;
private string _Text;
public string ID...
public string Text...
public ItemClass(string ID, string Text)...
}
....
drop = new ComboBox();
drop.DisplayMember = "Text";
drop.ValueMember = "ID";
ArrayList aList = new ArrayList();
PopulateArrayList(aList);
drop.DataSource = aList;
// Would like to search for item to select here, but drop.Items.Count =
0 !!!