RadioButton's in different containers belonging to the same group.

  • Thread starter Thread starter Velislav
  • Start date Start date
V

Velislav

Hi,

I've got 9 RadioButton's in a TableLayoutPanel container

They all need to be in the same group, but 2 of them are in
FlowLayoutPanel containers within the cells of the TableLayoutPanel,
hence i have 1 group of 7 RadioButton's and 2 groups of 1 RadioButton
and not 1 group of 9 RadioButton's.

Is there any way to group RadioButton's other than the containers they
belong to?

Thanks.
 
Velislav said:
Is there any way to group RadioButton's other than the containers they
belong to?

Yes, use set of single radiobuttons with same GroupName:
Ex.:
<asp:RadioButton ID="r1" runat="server" GroupName="Group1"/>
<asp:RadioButton ID="r2" runat="server" GroupName="Group1" />
<table>
<tr>
<td><asp:RadioButton ID="r3" runat="server"
GroupName="Group2"/></td>
</tr>
<tr>
<td><asp:RadioButton ID="r4" runat="server"
GroupName="Group2"/></td>
</tr>
........
</table>
 
Yes, use set of single radiobuttons with same GroupName:

Ooops, forgot to explicitly mention these are
System.Windows.Forms.RadioButton's, not
System.Web.UI.WebControls.RadioButton's.

The Windows control doesn't have the GroupName property and (at first
glance) the container it belongs to appears to be the only way of
grouping a number of them.

Thanks though.
 
Back
Top