mutually exclusive radio button

Discussion in 'ASP .Net' started by js, May 18, 2005.

  1. js

    js Guest

    I include a asp:RadioButton in an ItemTemplate of a DataGrid like the
    following. However, the radio buttons are not mutual exclusive where
    select one will deselect the rest of the radio buttons. I know there is
    a similar bug with RadioButton in a DataList. Does this bug also apply
    to Datagrid? If not, how can I set them to be selected mutually
    exclusively?

    <asp:datagrid id="MyDataGrid" runat="server" CssClass="InventoryTable">
    <ItemStyle CssClass="inventoryListItemStyle"></ItemStyle>
    <AlternatingItemStyle CssClass="inventoryListAlternateItemStyle" />
    <HeaderStyle CssClass="inventoryListHeaderStyle"></HeaderStyle>
    <Columns>
    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:RadioButton ID="rdoSelected" Runat="server"
    GroupName="rdoGroup"/>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>
     
    js, May 18, 2005
    #1
    1. Advertising

  2. js

    Brock Allen Guest

    Try the RadioButtonList instead.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I include a asp:RadioButton in an ItemTemplate of a DataGrid like the
    > following. However, the radio buttons are not mutual exclusive where
    > select one will deselect the rest of the radio buttons. I know there
    > is a similar bug with RadioButton in a DataList. Does this bug also
    > apply to Datagrid? If not, how can I set them to be selected mutually
    > exclusively?
    >
    > <asp:datagrid id="MyDataGrid" runat="server"
    > CssClass="InventoryTable">
    > <ItemStyle CssClass="inventoryListItemStyle"></ItemStyle>
    > <AlternatingItemStyle CssClass="inventoryListAlternateItemStyle" />
    > <HeaderStyle CssClass="inventoryListHeaderStyle"></HeaderStyle>
    > <Columns>
    > <asp:TemplateColumn>
    > <ItemTemplate>
    > <asp:RadioButton ID="rdoSelected" Runat="server"
    > GroupName="rdoGroup"/>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:datagrid>
     
    Brock Allen, May 19, 2005
    #2
    1. Advertising

  3. js

    js Guest

    This won't work because I need only ONE radio button in the first
    column of each data row in DataGrid. I need to allow sorting on the
    DataGrid header which RadioButtonList does not support or it is not
    easy to implement. Any more idea? Thanks.
     
    js, May 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page