Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I have one clear Button,using clear button how to uncheck the radio button.
 
Clear button
 
Radio button.
 
when i click the clear button, i want to uncheck the radio button.
 
how can i do using csharp.
 
i tried but it is not working.
 
My code as follows;
 
SessAM.Checked = false;
 

from my above code what is the problem.
 
the code is not working.
note it is windows application.
Posted 11-Mar-13 0:40am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A radio button option group is provided so that a user chooses at least one option.
So have a default that is selected when the user clears the screen.
 
You should not ideally be providing an option to clear out all option buttons.
If you want this functionality, use checkboxes instead.
  Permalink  
v2
Comments
onurag19 at 11-Mar-13 5:53am
   
+5. Nice Advice You can't use radio button.
Abhinav S at 11-Mar-13 5:55am
   
Thanks.
Marcus Kramer at 11-Mar-13 10:12am
   
+5.
Abhinav S at 11-Mar-13 10:25am
   
Thank you.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

hello professional
 
ya if there is group of radio button then its good to contain them in Group box or panel container control that will automatically select only one radio button at a time that no need to checked=false or true on any click event
so put them on a container control.
 

Happy to help
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

If you need to get only a option from a list use radioButtons if you need multi-options form your list use checkBoxes. CheckBoxes can be all unchecked. RadioButtons can have only one active one and that active one can't be unchecked. Try to drag your radioButtons to an GroupBox and then you will create groups of radioButtons that will work individual from the rest. Then you can disable your radioButtons like this when you click your ClearButton:
 
groupBox1.Enabled = false;
or
groupBox1.Hide();
 
You can also try if it helps you:
 
SessAM.Enabled = false;
 
Good Luck!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,130
1 DamithSL 5,089
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,647
4 Kornfeld Eliyahu Peter 4,409


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100