/// <summary> /// Load UI cultures for the dropdown list. /// </summary> private void LoadCultures() { CMSDropDownList drpCulture = (CMSDropDownList)Login1.FindControl("drpCulture"); if (drpCulture != null) { DataSet ds = CultureInfoProvider.GetUICultures(); DataView dvCultures = ds.Tables[0].DefaultView; dvCultures.Sort = "CultureName ASC"; drpCulture.DataValueField = "CultureCode"; drpCulture.DataTextField = "CultureName"; drpCulture.DataSource = dvCultures; drpCulture.DataBind(); // Add default value drpCulture.Items.Insert(0, new ListItem(GetString("LogonForm.DefaultCulture"), "")); LocalizedLabel lblCulture = (LocalizedLabel)Login1.FindControl("lblCulture"); if (lblCulture != null) { lblCulture.AssociatedControlID = drpCulture.ID; lblCulture.Text = ResHelper.GetString("general.select"); lblCulture.Display = false; } } }
private void FillAddressList(CMSDropDownList list) { // Add new item <(new), 0> var newAddressOption = new ListItem(GetString("ShoppingCartOrderAddresses.NewAddress"), "0"); list.DataSource = mCustomerAddresses; list.DataBind(); list.Items.Insert(0, newAddressOption); }