Solved

easy question about radiobutton.

Posted on 2008-10-30
10
175 Views
Last Modified: 2013-11-08
I need to have man and women on the same line
<asp:RadioButtonList ID="GrpGender" runat="server" RepeatDirection="Horizontal"
                RepeatColumns="2">
            <asp:ListItem Text="Male" Selected="True" Value="M">
            </asp:ListItem>
            <asp:ListItem Text="Women" Value="F"></asp:ListItem>
        </asp:RadioButtonList>
what should I do?
0
Comment
Question by:mathieu_cupryk
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
What is not showing correctly with what you have?  That appears to be the correct code to put them on same line.  Only thing I would suggest is be consistent with verbiage.  Either Man | Woman OR Male | Female.
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Maybe you are talking about the look and feel of it.  Try using the Flow layout instead of Table.
<asp:RadioButtonList ID="GrpGender" runat="server" 

            RepeatDirection="Horizontal" RepeatLayout="Flow">

            <asp:ListItem Text="Man" Selected="True" Value="M" />

            <asp:ListItem Text="Woman" Value="F" />

        </asp:RadioButtonList>

Open in new window

0
 

Author Comment

by:mathieu_cupryk
Comment Utility
i gives me this
I am *  
Man

Woman


I want
I am* [] Man [] Women
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
I just tried it the way I posted and comes out on same line.  Maybe you have something wrapping the line.  Check design code for width restrictions.
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Post the snippet of code for that entire section including any surrounding DIV tags, etc.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 6

Expert Comment

by:M3mph15
Comment Utility
Hi,

I would create 2 seperate radio buttons side by side and when one is clicked on the CheckedChanged uncheck the other radio button.

E.g.
Protected Sub RadioButton1_CheckedChanged() Handles RadioButton1.CheckedChanged
      If RadioButton1.Checked Then
                 RadioButton2.Checked = False
      End If
End Sub

Hope this helps
-M3mph15
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
<tr>
        <td class="label" align="left" height="25"><b>I am *</b>&nbsp;</td>
     
        <td class="">
        <asp:RadioButtonList ID="GrpGender" runat="server"
            RepeatDirection="Horizontal" RepeatLayout="Flow" Width="215px">
            <asp:ListItem Text="Man" Selected="True" Value="M" />
            <asp:ListItem Text="Woman" Value="F" />
        </asp:RadioButtonList>

        </td>
    </tr>

30-10-2008-10-39-13-PM.png
0
 
LVL 5

Expert Comment

by:varungd
Comment Utility
Increase the width of that radio button
0
 
LVL 5

Expert Comment

by:varungd
Comment Utility
Otherwise increase the table width
0
 
LVL 6

Accepted Solution

by:
AmarIs26 earned 500 total points
Comment Utility
you need to increase the width of the cell (<td>) that the radio buttons are in.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

10 Experts available now in Live!

Get 1:1 Help Now