Orientation of a RadioButtonList in 3.5 using C#

Posted on 2008-11-13
Last Modified: 2012-05-05
Hello Experts!!!
I want to orient by radio buttons vertically with each button one over the other and the text to the right of the radio button.  The only way I am aware of to adjust the orientation of the radiobuttons is via RepeatDirection="Vertical".  The problem is this causes the text to be in a vertical orientation as well.  The result is radio buttons oriented vertically with there text description below each button.  In my opinion this looks rather ridiculous however I have not found an alternative way of orienting them.  Does anyone have a better way.  See the attached snippet of code.  Thanks for your help!!!!
<asp:RadioButtonList ID="_SOMEID" runat="server" RepeatDirection="Vertical">

                                    <asp:ListItem Text="Yes" Value="1" Selected="false"></asp:ListItem>

                                    <asp:ListItem Text="No" Value="2" Selected="false"></asp:ListItem>

                                    <asp:ListItem Text="Don't Know" Value="3" Selected="false"></asp:ListItem>


Open in new window

Question by:SomeGuy892
    LVL 5

    Expert Comment

    try style:
    <asp:RadioButtonList ID="RadioButtonList1" runat="server" style="table-layout: auto; border-collapse: separate" Width="626px">
    LVL 26

    Accepted Solution

    i tried your code snipped and i think i got correct results (not the way you suggested but the way i thought it should come)
    the radio buttons were rendered as shown below
     () Yes
     () No
     () Don't Know

    let us know if you still face any problems - Ragi

    Author Comment

    Ok it has been a while since i have had the opportunity to take a look at this again and Ragi you are right the code snippet that I provided doesn't reproduce the issue.  The problem seems to come from the Masterpage.  I didn't create this masterpage and I am trying to get an idea of where to start looking any ideas?

    Author Comment

    Even closer still it is in the stylesheet inherited via the Masterpage.  Still looking let me know if you have any thoughts.

    Author Comment

    Ok I have found the specific line of code in the stylesheet that is my problem.  I am going to close this question out and will start a followup question.

    Author Closing Comment

    You didn't provide the complete answer to my problem but you did call me out on the issue not being present in my sample code snippet which was corrected and pointed me in the right direction.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now