Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys
I have to separate group of radio button in my form.
for example radiobutton1 & radiobutton2 in group 1 , radiobutton3 & radiobutton4 in group 2.

i want if user checked radiobutton 1 just radio button2 be unchecked not affected on radiobutton3 & radiobutton4 and if user checked radiobutton4 just radiobutton3 be unchecked not radiobutton1 & radiobutton2.

tnx for your responsibility.
Posted

Put them in a GroupBox: http://msdn.microsoft.com/en-us/library/system.windows.forms.groupbox.aspx[^] - use a separate Group for each set of radio buttons,. and they will be independent of each other.
 
Share this answer
 
Try this one
C#
protected void rad1_CheckedChanged(object sender, EventArgs e)
   {
       if (rad1.Checked == true)
       {
           rad2.Checked = false;
       }
   }
   protected void rad2_CheckedChanged(object sender, EventArgs e)
   {
       if (rad2.Checked == true)
       {
           rad1.Checked = false;
       }
   }
   protected void rad3_CheckedChanged(object sender, EventArgs e)
   {
       if (rad3.Checked == true)
       {
           rad4.Checked = false;
       }
   }
   protected void rad4_CheckedChanged(object sender, EventArgs e)
   {
       if (rad4.Checked == true)
       {
           rad3.Checked = false;
       }
   }

hope It will be helpfull for You.
Thanks
 
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