Skip to content

Instantly share code, notes, and snippets.

@SitefinityGuru
Created April 5, 2012 23:24
Show Gist options
  • Save SitefinityGuru/2315006 to your computer and use it in GitHub Desktop.
Save SitefinityGuru/2315006 to your computer and use it in GitHub Desktop.
Bind to a List of Countries using Sitefinity Ecommerce Config
Country.DataSource = Config.Get<EcommerceConfig>().Countries.Values.Where(x => x.CountryIsActive == true).ToList().OrderBy(x => x.Name);
Country.DataTextField = "Name"; // other properties: IsoCode, Culture, CurrencyName, CurrencyIsoCode, CurrencyIsoNumericCode
Country.DataValueField = "Name";
Country.DataBind();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment