Ortund
Ortund

Reputation: 8255

Radiobutton text in-line

I'm trying to get a Yes/No RadioButtonList set up on my page rendered as follows:

[=] Yes [=] No

Currently, my code in my .skin file looks like this:

<asp:RadioButtonList runat="server" RepeatDirection="Horizontal" RepeatColumns="2"></asp:RadioButtonList>

The RBL is rendering like this:

[=] [=]
Yes No

I haven't written any CSS for it so that's all that's involved in the list's presentation.

To make it clear, I want to get the Yes/No text next to their respective radio buttons. Can anyone explain to me why they aren't and how to do it?

Upvotes: 1

Views: 2851

Answers (1)

captainsac
captainsac

Reputation: 2490

I didn't face this issue all of sudden. But I mentioned some small amount of Width(50px) to RadioButtonList then it was reproduced. Simply increase the Width of RadioButtonList by some amount. it will be rendered as you want.

In my case I gave Width="95px" as follows

    <asp:RadioButtonList Width="95px" ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="2">
        <asp:ListItem Text="Yes"></asp:ListItem>
        <asp:ListItem Text="No"></asp:ListItem>
    </asp:RadioButtonList>

Output

enter image description here

Upvotes: 1

Related Questions