RadioButton in a DataGrid

From: (
Date: 09/27/02

From: "" <>
Date: Thu, 26 Sep 2002 16:57:23 -0700


I have been trying to put a radiobutton server control inside a datagrid .
but the radio buttons being generated on the webform are not mutually
here is the code:

<asp:datagrid id="datagridVendor" runat="server" Width="460px" Height="25px"
AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
      <asp:TemplateColumn SortExpression="VendorName" HeaderText="Vendor
                   <asp:RadioButton id="rb" Enabled=True Runat=server
GroupName="Grp1" ></asp:RadioButton>

Now the reason why they are not mutaully exclusive at run time is that
ASP.NET changes the IDs of these radio buttons. Here is what i see when I do
a "View Source" in the browser.

<input id="datagridVendor__ctl2_rb" type="radio"
name="datagridVendor:_ctl2:Grp1" value="rb" />
<input id="datagridVendor__ctl3_rb" type="radio"
name="datagridVendor:_ctl3:Grp1" value="rb" />

Any idea why is this happening ???????

Thanks in advance.