/// <summary> /// /// </summary> /// <param name="nationality"></param> public void Bind(CragType type) { Items.Clear(); List<string> orderedTypes = (from c in System.Enum.GetNames(typeof(CragType)) orderby c select c).ToList(); foreach (string n in orderedTypes) { int countryID = ((int)((CragType)System.Enum.Parse(typeof(CragType), n, true))); DropDownListItem item = new DropDownListItem(n.ToString(), countryID.ToString()); if ((int)type == countryID) { item.Selected = true; } Items.Add(item); } }
/// <summary> /// /// </summary> /// <param name="nationality"></param> public void Bind(CragType type) { Items.Clear(); List <string> orderedTypes = (from c in System.Enum.GetNames(typeof(CragType)) orderby c select c).ToList(); foreach (string n in orderedTypes) { int countryID = ((int)((CragType)System.Enum.Parse(typeof(CragType), n, true))); DropDownListItem item = new DropDownListItem(n.ToString(), countryID.ToString()); if ((int)type == countryID) { item.Selected = true; } Items.Add(item); } }