Using Enums in List Controls
Posted by: Rick Strahls WebLog,
on 20 Feb 2009 |
View original | Bookmarked: 0 time(s)
Quite frequently in Web and Windows apps, Ive found it necessary to display data values contained in an Enum type typically inside of a list or combobox type control. Assume that you want to display a drop down list from this enumeration of bug status types: public enum BugStatusTypes
{
Entered,
InProcess,
Fixed,
ByDesign,
NotReproducible,
NoBug,
None
}
You can then do something akin to this to turn that enumeration into values to use in the dropdown:
protected...