I am using a custom ListItem class in order to fill a windows forms combobox (in DropDownList style). I am filling the control fine, but how do I get the id (NOT the name) upon cmbProgramName_SelectedIndexChanged?
public class ListItem
{
private string id = string.Empty;
private string name = string.Empty;
public ListItem(string sid, string sname)
{
id = sid;
name = sname;
public override string ToString()
{
return this.name;
}
public string ID
{
get
{
return this.id;
}
set
{
this.id = value;
}
}
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
}