Solved

ASP.net Show radio buttons on right of bound data

Posted on 2015-01-21
5
174 Views
Last Modified: 2015-01-25
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
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40563300
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
 

Author Comment

by:murbro
ID: 40563627
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40564316
<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
 

Author Closing Comment

by:murbro
ID: 40570037
Thanks very  much
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

696 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