DataBinding to Enum Values

When you have an Enum variable, and you want to build a UI to let the user choose one of this values, it's very convenient to show the user the current allowed values of the Enum.

You can avoid duplicate data, doing this... (note it uses reflection, so in high performance environments you should cache this info)

comboBox.DataSource = typeof(YourEnumType).GetFields(BindingFlags.Public);

comboBox.DisplayMember = "Name";