public void LoadCountries() { using (GeoNamesClient client = new GeoNamesClient()) { var countries = client.GetCountries("it", GeoStyle.Full); List<GeoCountry> countryList = new List<GeoCountry>(); try { foreach (var country in countries) { string strID = country.CountryCode; string strName = country.CountryName; ???// ?.Add(strName, strID); } } _ddlCountry.DataTextField = "Country"; _ddlCountry.DataValueField = "CountryCode"; _ddlCountry.DataSource = ?; _ddlCountry.DataBind(); // Insert the first item. _ddlCountry.Items.Insert(0, new RadComboBoxItem("- Select your country -"));
↧
Need to populate dropdownlist with List Collection.
↧