Let\'s say I have the following simple enum:
enum Response { Yes = 1, No = 2, Maybe = 3 }
How can I bind this enum to a DropDow
This is my solution for Order an Enum and DataBind(Text and Value)to Dropdown using LINQ
var mylist = Enum.GetValues(typeof(MyEnum)).Cast().ToList().OrderBy(l => l.ToString()); foreach (MyEnum item in mylist) ddlDivisao.Items.Add(new ListItem(item.ToString(), ((int)item).ToString()));