Why a radiobuttonlist always take a new row?

你说的曾经没有我的故事 提交于 2019-12-04 23:48:02

RadioButtonList by default renders as table. You can change set the property RepeatLayout="Flow" and it will be rendered in span.

RepeatLayout Property

Different ways it can render

Add a property to your radiobuttonlist

RepeatDirection="Horizontal"

   <asp:RadioButtonList RepeatDirection="Horizontal" 
        ID="RadioButtonList1" runat="server" style="display:inline">
        <asp:ListItem>asdf</asp:ListItem>
        <asp:ListItem>sdfg</asp:ListItem>
    </asp:RadioButtonList>

this will solve your problem. CHEERS

You can set it's display style to be inline:

<asp:RadioButtonList
    ID="RadioButtonList1" runat="server" style="display:inline">
    <asp:ListItem>asdf</asp:ListItem>
    <asp:ListItem>sdfg</asp:ListItem>
</asp:RadioButtonList>

Warning: Purists will scream that information should be in a CSS class somewhere else.

if you have apply css on page, then it is hard to maintain style of radiobuttonlist.

Mine was fix with below code

#radiobuttonlist label
{
   vertical-align: super;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!