RadioButton in DataList

Discussion in 'ASP .Net' started by David Lozzi, Sep 19, 2006.

  1. David Lozzi

    David Lozzi Guest

    Howdy,

    Using ASP.NET 2.0 with VB. I have a datalist that is listing out options.
    Ecah option has a radio button for which the user has to select only one
    option from the list. It displays properly but it appears to be not working
    properly. They can select all of the radiobuttons at once. Not very good!
    How do I set it up so each radiobutton is part of the group? I'm using the
    GroupName option but no luck. See my HTML below.

    Thanks

    David


    <asp:DataList ID="dlOptions" runat="server">
    <ItemTemplate>
    <td>
    <asp:RadioButton ID="radOption" Text='<%#Eval("Cost") %>'
    runat="server" GroupName='<%# Eval("ShipTo")%> /></td>
    <td><asp:Label runat="server" ID="lblShipName"
    Text='<%#Eval("Name") & "-" & Eval("Desc")%>'></asp:Label>
    <asp:Label runat="server" ID="lblShipType" Text='<%#Eval("Type")
    %>'></asp:Label></td>
    </ItemTemplate>
    <SeparatorTemplate>
    <td>&nbsp;</td>
    </SeparatorTemplate>
    <FooterTemplate>
    <td><img src="site_images/spacer.gif" width="80" height="1"
    /></td>
    <td><img src="site_images/spacer.gif" width="600" height="1"
    /></td>
    </FooterTemplate
    David Lozzi, Sep 19, 2006
    #1
    1. Advertising

  2. David Lozzi

    David Lozzi Guest

    After doing some research and discovering its basically impossible, I just
    lined up a RadioButtonList next to a datagrid so the options lined up and it
    works great.

    thanks,
    David



    "David Lozzi" <> wrote in message
    news:...
    > Howdy,
    >
    > Using ASP.NET 2.0 with VB. I have a datalist that is listing out options.
    > Ecah option has a radio button for which the user has to select only one
    > option from the list. It displays properly but it appears to be not
    > working properly. They can select all of the radiobuttons at once. Not
    > very good! How do I set it up so each radiobutton is part of the group?
    > I'm using the GroupName option but no luck. See my HTML below.
    >
    > Thanks
    >
    > David
    >
    >
    > <asp:DataList ID="dlOptions" runat="server">
    > <ItemTemplate>
    > <td>
    > <asp:RadioButton ID="radOption" Text='<%#Eval("Cost") %>'
    > runat="server" GroupName='<%# Eval("ShipTo")%> /></td>
    > <td><asp:Label runat="server" ID="lblShipName"
    > Text='<%#Eval("Name") & "-" & Eval("Desc")%>'></asp:Label>
    > <asp:Label runat="server" ID="lblShipType" Text='<%#Eval("Type")
    > %>'></asp:Label></td>
    > </ItemTemplate>
    > <SeparatorTemplate>
    > <td>&nbsp;</td>
    > </SeparatorTemplate>
    > <FooterTemplate>
    > <td><img src="site_images/spacer.gif" width="80" height="1"
    > /></td>
    > <td><img src="site_images/spacer.gif" width="600" height="1"
    > /></td>
    > </FooterTemplate
    >
    David Lozzi, Sep 21, 2006
    #2
    1. Advertising

  3. David Lozzi

    tiagocolombo

    Joined:
    Oct 20, 2006
    Messages:
    1
    tiagocolombo, Oct 20, 2006
    #3
  4. David Lozzi

    abhinavranjan19

    Joined:
    Aug 22, 2012
    Messages:
    1
    abhinavranjan19, Aug 22, 2012
    #4
    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.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,835
  2. Luis Esteban Valencia Muñoz
    Replies:
    0
    Views:
    747
    Luis Esteban Valencia Muñoz
    Jun 3, 2005
  3. Gert
    Replies:
    0
    Views:
    469
  4. ensingg
    Replies:
    0
    Views:
    659
    ensingg
    Sep 15, 2006
  5. ensingg

    Radiobutton inside datalist

    ensingg, Sep 17, 2006, in forum: .NET
    Replies:
    0
    Views:
    619
    ensingg
    Sep 17, 2006
Loading...

Share This Page