How to bind enumerations into the DropDownList control?

Posted by Raja under C# category on | Views : 1588
To bind the enumerations into DropDownList control use following code snippets

string[] myStatus = Enum.GetNames(typeof(MyStatus)); // MyStatus is the name of the enumeration
myStatus.DataSource = userStatus;

Thank you.

Comments or Responses

Posted by: Nishithraj on: 1/14/2010 Level:Bronze | Status: [Member]
I think you made some typo error in the code. It should be

myStatus.DataSource = myStatus;

Login to post response