G
Guest
I have derived from a combo box which is linked to a static list of countries
in the constructor I have used the following in the constructor to populate
the box
InitializeComponent();
_pList = new ArrayList();
_pList.Add(new CountryCodeItem("ALB","Albania"));
_pList.Add(new CountryCodeItem("DZA","Algeria"));
_pList.Add(new CountryCodeItem("GBR","United Kingdom"));
_pList.Add(new CountryCodeItem("USA","United States"));
// I then attach it and identify functions to use to manipulate the data
columns.
this.DataSource = _pList;
this.ValueMember = "Code";
this.DisplayMember = "Description";
I then need to set the default to the United Kingdom but at this point item
count is zero, How do I set the default value on initialisation.
in the constructor I have used the following in the constructor to populate
the box
InitializeComponent();
_pList = new ArrayList();
_pList.Add(new CountryCodeItem("ALB","Albania"));
_pList.Add(new CountryCodeItem("DZA","Algeria"));
_pList.Add(new CountryCodeItem("GBR","United Kingdom"));
_pList.Add(new CountryCodeItem("USA","United States"));
// I then attach it and identify functions to use to manipulate the data
columns.
this.DataSource = _pList;
this.ValueMember = "Code";
this.DisplayMember = "Description";
I then need to set the default to the United Kingdom but at this point item
count is zero, How do I set the default value on initialisation.