Solved

ASP.net GridView - put extra columns last instead of first

Posted on 2011-09-29
2
219 Views
Last Modified: 2012-05-12
Hi

I am using the code shown below to put 5 extra radio buttons at as the first five columns of
a Gridview. How do I modify this code to make them the last 5 columns after the bound data?

Thanks
<asp:GridView ID="GridView2" runat="server" CellPadding="4" 
            ForeColor="#333333" GridLines="None">  
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns> 
                <asp:TemplateField>
                   <ItemTemplate>
                       <asp:RadioButton ID="RadioButton1" runat="server" />
                  </ItemTemplate>
               </asp:TemplateField> 
                      <asp:TemplateField>
                   <ItemTemplate>
                       <asp:RadioButton ID="RadioButton2" runat="server" />
                  </ItemTemplate>
               </asp:TemplateField> 
                      <asp:TemplateField>
                   <ItemTemplate>
                       <asp:RadioButton ID="RadioButton3" runat="server" />
                  </ItemTemplate>
               </asp:TemplateField> 
                      <asp:TemplateField>
                   <ItemTemplate>
                       <asp:RadioButton ID="RadioButton4" runat="server" />
                  </ItemTemplate>
               </asp:TemplateField> 
                      <asp:TemplateField>
                   <ItemTemplate>
                       <asp:RadioButton ID="RadioButton5" runat="server" />
                  </ItemTemplate>
               </asp:TemplateField> 
            </Columns> 
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />  
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />  
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />  
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />  
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />  
            <SortedAscendingCellStyle BackColor="#E9E7E2" />  
            <SortedAscendingHeaderStyle BackColor="#506C8C" />  
            <SortedDescendingCellStyle BackColor="#FFFDF8" />  
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />  
        </asp:GridView>

Open in new window

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 Comments
 
LVL 10

Accepted Solution

by:
JPJ78 earned 500 total points
ID: 36814053
If it is possible I would imagine setting autogenerateColumns="true" would be the answer.
But as far as I know you can't mix autogenerated columns with user defined columns, you simple have to define the columns that are normally autogenerated.
0
 

Author Closing Comment

by:murbro
ID: 36918537
thanks for the help
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 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