.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Collections >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Add Enumaration value into Dropdown Box using C#.Net

Posted By:Narayanan       Posted Date: August 03, 2012    Points: 40    Category: Collections    URL: http://www.dotnetspark.com  

It is possible to add Enumaration value into Dropdown Box using C#.Net.here i give an example.
 

 First Create a Enumeration using Enum Keyword.

    enum days
        {
            Monday=1,
            Friday,
            Sunday
        }
add a enum value into Dropdown box.

Create Drop down box .
add this code in the Form loading or button click event or any where...
         comboBox1.Items.Add(days.Friday);
             comboBox1.Items.Add(days.Monday );
             comboBox1.Items.Add(days.Sunday);



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend