Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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

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.
 
Share this answer
 
v2
Comments
[no name] 11-Mar-13 5:53am    
+5. Nice Advice You can't use radio button.
Abhinav S 11-Mar-13 5:55am    
Thanks.
fjdiewornncalwe 11-Mar-13 10:12am    
+5.
Abhinav S 11-Mar-13 10:25am    
Thank you.
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
 
Share this answer
 
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:

C#
groupBox1.Enabled = false;

or
C#
groupBox1.Hide();


You can also try if it helps you:

C#
SessAM.Enabled = false;


Good Luck!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900