How can I bind the following to a comboBox in the compact framework? I'm
looking at this example here:
http://samples.gotdotnet.com/quickst...FormsData.aspx
When I do the following, i just get the application name appearing in the
ComboBox.
Thanks in advance.
struct comboItem
{
private string name;
private string id;
public string Name
{
get{ return name; }
}
public string Id
{
get{ return id; }
}
public comboItem(string name, string id)
{
this.name = name;
this.id = id;
}
}
//create the items
comboItem[] items= new comboItem[3];
items[0] = new comboItem("London", "567567");
items[1] = new comboItem("Paris", "34535");
items[2] = new comboItem("Glasgow", "12312");
//bind to comboBox1
this.comboBox1.DataSource = items;
this.comboBox1.DisplayMember = "name";
this.comboBox1.ValueMember = ="id";