Enums in DropDownList

I was talking to someone who had to do this today, and couldn't find any code to do it. Here's some old code I had lying around, maybe it's of interest to others.

Binding an enum type:

control.DataSource = Enum.GetNames( typeof(YourEnumType) );

Getting an enum value back from the string value:

YourEnumType myEnum = (YourEnumType)Enum.Parse( typeof(YourEnumType), control.SelectedValue);

If anyone has a simplified or better way to do this, please share.

Consumer Tech