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 / .NET Framework / General / September 2005

Tip: Looking for answers? Try searching our database.

enabling\disabling a radiobutton

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leonard - 30 Sep 2005 15:47 GMT
I have several radio buttons for the user to choose from.  I need to enable
or disable a particular radio button, depending on a certain condition.

How can I do this?

Thanks, Leonard
Morten Wennevik - 30 Sep 2005 15:58 GMT
Hi Leonard,

I'm not sure what you mean.  Unless you simply are looking for the Enabled property.  Set the Enabled property to false for the RadioButton in question when you test the condition.

> I have several radio buttons for the user to choose from.  I need to enable
> or disable a particular radio button, depending on a certain condition.
>
> How can I do this?
>
> Thanks, Leonard

Signature

Happy coding!
Morten Wennevik [C# MVP]

Leonard - 30 Sep 2005 16:25 GMT
Sorry, I should have been more clear.  I don't want to disable all of the
radio buttons in the group, only a single one in the collection.

> Hi Leonard,
>
[quoted text clipped - 6 lines]
> >
> > Thanks, Leonard
kea - 30 Sep 2005 17:52 GMT
As Morten says, you just disable the specific radiobutton. F.x. if we
have 3 radiobuttons (rb1, rb2, rb3) in a groupbox (grp_radiobuttons)
and you want to disable rb2, then you just write rb2.enabled = false.
Leonard - 30 Sep 2005 18:22 GMT
I apologize.  I'm kind of new at this.  I have just discovered the control
the radio buttons are on are a radiobuttonlist control.  Should I make them
radio buttons and put them in a group box?  The help indicates it is easier
to determine which one was selected, in a radiobuttonlist control.

> As Morten says, you just disable the specific radiobutton. F.x. if we
> have 3 radiobuttons (rb1, rb2, rb3) in a groupbox (grp_radiobuttons)
> and you want to disable rb2, then you just write rb2.enabled = false.
Morten Wennevik - 30 Sep 2005 19:23 GMT
I'm afraid I'm not familiar with the RadioButtonList (for future reference indicate if the control in question is a web control as they differ somewhat from windows controls), but I don't think you can enable a single RadioButton in that list.  You can as you say use individual RadioButtons in a container control like a GroupBox and enable and disable them as you like.

Signature

Happy coding!
Morten Wennevik [C# MVP]

Leonard - 30 Sep 2005 19:58 GMT
Thanks

> I'm afraid I'm not familiar with the RadioButtonList (for future reference indicate if the control in question is a web control as they differ somewhat from windows controls), but I don't think you can enable a single RadioButton in that list.  You can as you say use individual RadioButtons in a container control like a GroupBox and enable and disable them as you like.

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.