public void LoadCountries() { using (GeoNamesClient client = new GeoNamesClient()) { var countries = client.GetCountries("it", GeoStyle.Full); Dictionary<string, string> countryList = new Dictionary<string, string>(); try { foreach (var country in countries) { string strID = country.CountryCode; string strName = country.CountryName; countryList.Add(strName, strID); } _ddlCountry.DataTextField = "Key"; _ddlCountry.DataValueField = "Value"; _ddlCountry.DataSource = countryList; _ddlCountry.DataBind(); // Insert the first item. _ddlCountry.Items.Insert(0, new RadComboBoxItem("- Select your country -")); } catch (Exception ex) { } } }
Sort before.