Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

how to set group name in chek box and radio button. am selecting only one item then another item will be unchecked. but am getting both items will be selecting mode.
only check box will comes in checked and unchecked mode. radio button will not coming in windows application. how to solve this problem.

thanks in advance
Posted
Comments
palraj001 6-Nov-11 23:53pm    
in windows there is no need to give group name .can u select two radio buttons at a time ???

Use RadioButton.GroupName or RadioButtonList control.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.groupname.aspx[^]
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobuttonlist.aspx[^]

[Edit: Forms Application]
The RadioButton control can display text, an Image, or both. When the user selects one option button (also known as a radio button) within a group, the others clear automatically. All RadioButton controls in a given container, such as a Form, constitute a group. To create multiple groups on one form, place each group in its own container, such as a GroupBox or Panel control.
Ref: http://msdn.microsoft.com/en-us/library/system.windows.forms.radiobutton.aspx[^]

So, if you want to select both the radiobutton then you have to put them on different containers like, panel or groupbox.
 
Share this answer
 
v2
Comments
K N R 6-Nov-11 23:07pm    
am using windows forms
Prerak Patel 7-Nov-11 0:09am    
But you tagged your question as ASP.Net. Anyways, edited the answer.
 
Share this answer
 
Instead of checkbox/radio button use checkboxlist and radiobuttonlist and provide group name to set only one value to be checked at a time.
 
Share this answer
 
Instead of checkbox and radio button you should use checkboxlist and radiobuttonlist for avoiding multiple select.
 
Share this answer
 
 
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