Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

CheckBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 12 Jun 2007 18:02 GMT
Hello,

I have an enumeration:

   ' Level
   Public Enum Level
     Professor
     Student
     ' ...
   End Enum ' Level

And a property of type Level:

   ' Levels
   Private _Levels As Generic.List(Of Level)
   Public Property Levels() As Generic.List(Of Level)
     Get
       Return _Levels
     End Get
     Set(ByVal value As Generic.List(Of Level))
       _Levels = value
     End Set
   End Property ' Levels

I need to display, in my web page, N CheckBoxes which one showing a
Level.

Then I want to check the CheckBoxes which value exists in the property
Levels (Generic List).

How can I do this?

Thanks,

Miguel
Göran Andersson - 12 Jun 2007 18:21 GMT
> Hello,
>
[quoted text clipped - 31 lines]
>
> Miguel

Loop through the values in the enum:

ForEach levelItem As Level in Enum.GetValues(GetType(Level))
   ...
Next

(I am not sure about the GetType(Level) part, that is supposed to return
the type of the enum.)

The levelItem variable will contain each of the values, so that you can
create a control for each of them and add it to the page. You can use
levelItem.ToString() to get the level value as a string so that you can
construct a unique id for each control.

You can use the Contains method on the list of levels to determine if a
specific level value exists in the list.

Signature

Göran Andersson
_____
http://www.guffa.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.