tags:

views:

50

answers:

1

If have the following enum

public enum EmployeeType
{
    Manager = 1,
    TeamLeader,
    Senior,
    Junior
}

and i have DropDownList and i want to bind this enum to it .. is it any way to do that ?

+1  A: 

if you have DropDownList object called ddl you can do it as below

ddl.DataSource = Enum.GetNames(typeof(EmployeeType));
ddl.DataBind();

if you want the Enum value Back on Selection ....

 EmployeeType empType= (EmployeeType)Enum.Parse(ddl.SelectedValue); 
Space Cracker
thanks that's what i search for
Hotmoil