easy question about radiobutton.

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?
mathieu_cuprykAsked:
Who is Participating?
 
AmarIs26Connect With a Mentor Commented:
you need to increase the width of the cell (<td>) that the radio buttons are in.
0
 
Kevin CrossChief Technology OfficerCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mathieu_cuprykAuthor Commented:
i gives me this
I am *  
Man

Woman


I want
I am* [] Man [] Women
0
 
Kevin CrossChief Technology OfficerCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
Post the snippet of code for that entire section including any surrounding DIV tags, etc.
0
 
M3mph15Commented:
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
 
mathieu_cuprykAuthor Commented:
<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
 
varungdCommented:
Increase the width of that radio button
0
 
varungdCommented:
Otherwise increase the table width
0
All Courses

From novice to tech pro — start learning today.