ASP:RadionButtonList Restricted In A Single Cell?

Discussion in 'ASP .Net Web Controls' started by Chan, Nov 3, 2003.

  1. Chan

    Chan Guest

    I'd like to place some radio buttons across a row of different <td>
    inside of a <tabl>, such as:

    -----------------------------
    | radio1 | radio2 | radio3 |
    -----------------------------

    All of them are sharing the same ID, say "rd".

    However, I can not do it in the following:

    <asp:radiobuttonlist id="rd" runat="server" autopostback="true">
    <table>
    <tr>
    <td><asp:listitem>radio1</asp:lineitem></td>
    <td><asp:listitem>radio2</asp:lineitem></td>
    <td><asp:listitem>radio3</asp:lineitem></td>
    </tr>
    </table>
    </asp:radiobuttonlist>

    ..Net complains:
    System.Web.UI.WebControls.ListItemCollection must have items of type
    'System.Web.UI.WebControls.ListItem'. 'table' is of type
    'System.Web.UI.HtmlControls.HtmlTable'.

    If <asp:radiobuttonlist> and its child can only be together as a
    whole, means no other html tags mixed within, it's not convenience at
    all.

    I guess workaround would be:
    - use <asp:radiobutton> for each individual w/ the same name.
    - use plain HTML tags.

    Thanks!
    Chan, Nov 3, 2003
    #1
    1. Advertising

  2. Set RepeatColumns = 3 for your example.


    >-----Original Message-----
    >I'd like to place some radio buttons across a row of

    different <td>
    >inside of a <tabl>, such as:
    >
    > -----------------------------
    > | radio1 | radio2 | radio3 |
    > -----------------------------
    >
    >All of them are sharing the same ID, say "rd".
    >
    >However, I can not do it in the following:
    >
    ><asp:radiobuttonlist id="rd" runat="server"

    autopostback="true">
    > <table>
    > <tr>
    > <td><asp:listitem>radio1</asp:lineitem></td>
    > <td><asp:listitem>radio2</asp:lineitem></td>
    > <td><asp:listitem>radio3</asp:lineitem></td>
    > </tr>
    > </table>
    ></asp:radiobuttonlist>
    >
    >..Net complains:
    >System.Web.UI.WebControls.ListItemCollection must have

    items of type
    >'System.Web.UI.WebControls.ListItem'. 'table' is of type
    >'System.Web.UI.HtmlControls.HtmlTable'.
    >
    >If <asp:radiobuttonlist> and its child can only be

    together as a
    >whole, means no other html tags mixed within, it's not

    convenience at
    >all.
    >
    >I guess workaround would be:
    >- use <asp:radiobutton> for each individual w/ the same

    name.
    >- use plain HTML tags.
    >
    >Thanks!
    >.
    >
    mike_bluestein@ya_StopSpammingMe_hoo.com, Nov 3, 2003
    #2
    1. Advertising

  3. Chan

    Chan Guest

    Thanks for the info.

    If there is a cell (<td/>) does not need anything, that is does not
    have <asp:listitem>, is it still ok?
    Chan, Nov 4, 2003
    #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.
Similar Threads
  1. coleenholley
    Replies:
    5
    Views:
    1,128
    coleenholley
    Jan 21, 2004
  2. Chris
    Replies:
    1
    Views:
    13,607
    Oisin
    Mar 24, 2006
  3. PW
    Replies:
    0
    Views:
    366
  4. Keith R
    Replies:
    2
    Views:
    423
    =?Utf-8?B?QklUUyBlcnJvciBjb2RlIC0yMTQ3MDI0ODkxIG9y
    Apr 24, 2007
  5. Replies:
    3
    Views:
    179
    Dominick Baier [DevelopMentor]
    May 13, 2006
Loading...

Share This Page