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...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: .NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 739 | Hits: 77

Similar Posts

  • ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities more
  • Choose your preferred data layout with RadListView for ASP.NET AJAX more
  • Formatting Text in RadControls for WinForms Q3 2009 more
  • Silverlight Toolkit adds DragDrop targets! more
  • Getting Loopy (Matt Gertz) more
  • Make SharePoint 2007 Act Like SharePoint 2010, Updated more
  • Customizing the SharePoint ECB with Javascript, Part 1 more
  • PDC 2009 Sessions Posted more
  • LINQ Tip of the week: System.String support more
  • Four Little Known, Helpful Methods, Properties, and Features for ASP.NET Developers more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD