Click here to Skip to main content
15,867,885 members
Articles / Web Development / ASP.NET
Alternative
Tip/Trick

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(); }}
here is what I do to iterate through enum


public static ABC(Type enumType)
{
  foreach (Enum e in Enum.GetValues(enumType))
  {
    int tvalue = Convert.ToInt32(e);
    string tname = e.ToString();    
  }
}

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

 
-- There are no messages in this forum --