How to bind the enum to dropdown list

Posted by Saratvaddilli under C# category on | Points: 40 | Views : 1582
We can bind the enum to droplist:
Let us assume that our enum was in someother project , now just add the dll and in the code behind do like this

if (!IsPostBack)
ddlType.DataSource = Enum.GetNames(typeof(SecurityType));
ddlAlgorithm.DataSource = Enum.GetNames(typeof(ServiceProvider));


Comments or Responses

Login to post response