Solved

ASP.net Show radio buttons on right of bound data

Posted on 2015-01-21
5
158 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

20 Experts available now in Live!

Get 1:1 Help Now