Click here to Skip to main content
15,886,137 members
Articles / Web Development / ASP.NET

Bind Enum data to Dropdown List By Sorting

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
30 Dec 2010CPOL 5.6K   1  
here is what I do to iterate through enumpublic static ABC(Type enumType){ foreach (Enum e in Enum.GetValues(enumType)) { int tvalue = Convert.ToInt32(e); string tname = e.ToString(); }}

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
26 Dec 2010#realJSOP
Can't you just call Enum.GetNames(), and then bind to the collection returned by that method?
Please Sign up or sign in to vote.
29 Dec 2010sat_nar 2 alternatives  

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions