• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

ASP.net Show radio buttons on right of bound data

Hi

My GridView below shows the radio button columns on the left of the bound data
I want to shift this to the right. How do I do that?


            <asp:GridView ID="GridView_Questions" runat="server" BackColor="White" 
                BorderColor="#3366CC" BorderStyle="Solid" BorderWidth="1px" CellPadding="4" 
                Height="147px" Visible="False" Width="795px">
                <Columns>
       
                               <asp:TemplateField HeaderText="Questions: read carefully and select an answer">
                                   <ControlStyle Height="220px" Width="700px" />
                                   <HeaderStyle HorizontalAlign="Left" Wrap="False" />

                                   <ItemStyle Wrap="True" />

                               </asp:TemplateField>
         
                               <asp:ImageField DataImageUrlField="Image" HeaderText="Image">
                               </asp:ImageField>
                               <asp:TemplateField HeaderText="1" ItemStyle-HorizontalAlign="Right">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                                   <ItemStyle HorizontalAlign="Left" />
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="2">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList2" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="3">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList3" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="4">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList4" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="5">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList5" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="Answer">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList6" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="0">a</asp:ListItem>
                                           <asp:ListItem Value="1">b</asp:ListItem>
                                           <asp:ListItem Value="2">c</asp:ListItem>
                                           <asp:ListItem Value="3">d</asp:ListItem>
                                           <asp:ListItem Value="4">e</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
         
 
                </Columns>

                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                <HeaderStyle BackColor="White" Font-Bold="False" ForeColor="#000066" />
                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                <RowStyle BackColor="White" ForeColor="#003399" />
                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SortedAscendingCellStyle BackColor="#EDF6F6" />
                <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                <SortedDescendingCellStyle BackColor="#D6DFDF" />
                <SortedDescendingHeaderStyle BackColor="#002876" />
            </asp:GridView>

Open in new window

Image1.jpg
0
Murray Brown
Asked:
Murray Brown
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
If you are talking about this HTML, then you should be able to move that down below the column HTML, with cut and paste operation.

                           <asp:TemplateField HeaderText="1" ItemStyle-HorizontalAlign="Right">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="1">Yes</asp:ListItem>
                                           <asp:ListItem Value="0">No</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                                   <ItemStyle HorizontalAlign="Left" />
                               </asp:TemplateField>

Open in new window

0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi Bob. Please show me what the html would look like after the cut and paste as I am not sure where to move it to. Thanks
0
 
Bob LearnedCommented:
<asp:TemplateField HeaderText="Answer">
                                   <ItemTemplate>
                                       <asp:RadioButtonList ID="RadioButtonList6" runat="server"
                                           RepeatDirection="Horizontal">
                                           <asp:ListItem Value="0">a</asp:ListItem>
                                           <asp:ListItem Value="1">b</asp:ListItem>
                                           <asp:ListItem Value="2">c</asp:ListItem>
                                           <asp:ListItem Value="3">d</asp:ListItem>
                                           <asp:ListItem Value="4">e</asp:ListItem>
                                       </asp:RadioButtonList>
                                   </ItemTemplate>
                               </asp:TemplateField>
         
<Paste the HTML here>
 
                </Columns>
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very  much
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now