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. Advertisements

  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. Advertisements

  3. David Lozzi

    tiagocolombo

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

    abhinavranjan19

    Joined:
    Aug 22, 2012
    Messages:
    1
    Likes Received:
    0
    abhinavranjan19, Aug 22, 2012
    #4
    1. Advertisements

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. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    509
    Gönen EREN
    Aug 22, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    2,304
  3. Luis Esteban Valencia Muñoz
    Replies:
    0
    Views:
    959
    Luis Esteban Valencia Muñoz
    Jun 3, 2005
  4. Gert
    Replies:
    0
    Views:
    557
  5. ensingg
    Replies:
    0
    Views:
    761
    ensingg
    Sep 15, 2006
  6. ensingg

    Radiobutton inside datalist

    ensingg, Sep 17, 2006, in forum: .NET
    Replies:
    0
    Views:
    723
    ensingg
    Sep 17, 2006
  7. Parker

    Mutually Exclusive RadioButton in DataList

    Parker, Jul 7, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    534
    Eliyahu Goldin
    Jul 7, 2004
  8. Rob Risner

    Datalist and RadioButton

    Rob Risner, Apr 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    10
    Views:
    1,020
    Sascha Bötzel
    Apr 27, 2004
Loading...