Re: RadioButton in a DataGrid

From: Bipin [MVP] (bipinjoshi@hotmail.com)
Date: 09/27/02


From: "Bipin [MVP]" <bipinjoshi@hotmail.com>
Date: Fri, 27 Sep 2002 07:19:44 +0530


Hi,
This is a known thing. DataGrid acts as a naming container for its child
controls and hence changes the name etc. In order to overcome this what you
can emit <INPUT> tags userself in some event like Item_Created or
Item_Databound and not use the <asp:RadioButton>.

--
Regards,
Bipin Joshi
Microsoft MVP | Developer | Author
Looking for .NET information?
Must visit www.DotNetBips.com for
articles, tutorials, demos and more...
--
"news.microsoft.com" <Saurabh@gtx.com> wrote in message
news:ucHZPhbZCHA.2532@tkmsftngp12...
> Hi
>
> 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
> exclusive.
> here is the code:
>
>
> <asp:datagrid id="datagridVendor" runat="server" Width="460px"
Height="25px"
> AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
>      <Columns>
>       <asp:TemplateColumn SortExpression="VendorName" HeaderText="Vendor
> Name">
>              <ItemTemplate>
>                    <asp:RadioButton id="rb" Enabled=True Runat=server
> GroupName="Grp1" ></asp:RadioButton>
>               </ItemTemplate>
>       </asp:TemplateColumn>
>      </Columns>
>  </asp:datagrid>
>
> 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.
>
> Saurabh
>
>
>
>


Relevant Pages

  • Re: Voice activated controls
    ... > Back in the Good Old Days the Crown had three radio controls. ... > where the dimmer would be on an American car. ... Ford Explorer a few years ago. ...
    (alt.autos.toyota)
  • Re: Returning lurker asks: is the DE1103 still the cats meow?
    ... travelling and camping. ... $130 Sony ICF-SW7600GR - it comes with a Sync Detector which is not ... ALL of its controls can easily be ... It delivers the same radio performance as the ...
    (rec.radio.shortwave)
  • Re: FM Switchoff
    ... minor controls and tape player are behind a flap above basically the ... of a standard radio. ... It depends on the car and the popularity of replacing the head unit. ...
    (uk.rec.audio)
  • Re: How do I create a fill-able form with word 2007 for Word 2003
    ... Microsoft MVP (Word) ... 'Legacy Forms' are the controls from the Forms Toolbar ... The 'radio button' choice is part of the ActiveX group, which, if you're ...
    (microsoft.public.word.docmanagement)
  • Re: Clear Differences Between the Tecsun S-2000 Radio -and- Grundig Satellit 750 Radio
    ... Tecsun S-2000 Radio and the re-badged Grundig Satellit 750 Radio. ... has Three Controls on bottom-right-front: ... Pre-Selector {Works with the Shortwave Bands? ... Please also note the [SSB] Button with USB/LSBhttp://gizmodo.com/photogallery/etonsatellit750/1000422293 ...
    (rec.radio.shortwave)