Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Put ASP.net GridView template columns on right instead of left

Hi

I have the following  ASP.net GridView with 5 template columns on the left. How do I change the columns to rather appear on the right

<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="Strongly Agree" HeaderStyle-Font-Size ="Small"
                                            ControlStyle-Font-Bold ="false" ControlStyle-Forecolor ="#006600"
                                            ControlStyle-Font-Size ="Smaller">
                    <ItemTemplate>
                        <asp:Button ID="Button6" runat="server"
                      CommandName="MyButton1"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Strongly Agree" />
                    </ItemTemplate>
                    <ControlStyle Font-Bold="False" Font-Size="Smaller" ForeColor="#006600" />
                    <HeaderStyle Font-Size="Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Agree" HeaderStyle-Font-Size ="Small" ControlStyle-Font-Bold ="false"
                                            ControlStyle-Forecolor ="#009900"
                    ControlStyle-Font-Size ="Smaller">
                    <ItemTemplate>
                        <asp:Button ID="Button7" runat="server"
                      CommandName="MyButton2"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Agree" />
                    </ItemTemplate>
                    <ControlStyle Font-Bold="False" Font-Size="Smaller" ForeColor="#009900" />
                    <HeaderStyle Font-Size="Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Undecided" HeaderStyle-Font-Size ="Small"
                                            ControlStyle-Font-Bold ="false" ControlStyle-Forecolor ="SlateGray"
                                            ControlStyle-Font-Size ="Smaller">
                    <ItemTemplate>
                        <asp:Button ID="Button8" runat="server"
                      CommandName="MyButton3"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Undecided" />
                    </ItemTemplate>
                    <ControlStyle Font-Bold="False" Font-Size="Smaller" ForeColor="SlateGray" />
                    <HeaderStyle Font-Size="Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Disagree" HeaderStyle-Font-Size ="Small"
                                            ControlStyle-Font-Bold ="false" ControlStyle-Forecolor ="#FF6600"
                                            ControlStyle-Font-Size ="Smaller">
                    <ItemTemplate>
                        <asp:Button ID="Button9" runat="server"
                      CommandName="MyButton4"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Disagree" />
                    </ItemTemplate>
                    <ControlStyle Font-Bold="False" Font-Size="Smaller" ForeColor="#FF6600" />
                    <HeaderStyle Font-Size="Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Strongly Disagree" HeaderStyle-Font-Size ="Small"
                                            ControlStyle-Font-Bold ="false" ControlStyle-Forecolor ="DarkRed"
                                            ControlStyle-Font-Size ="Smaller">
                    <ItemTemplate>
                        <asp:Button ID="Button10" runat="server"
                      CommandName="MyButton5"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Strongly Disagree" />
                    </ItemTemplate>
                    <ControlStyle Font-Bold="False" Font-Size="Smaller" ForeColor="DarkRed" />
                    <HeaderStyle Font-Size="Small" />
                </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>
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you mean you want to show the grid on the right hand side in its container control?
Avatar of Murray Brown

ASKER

I want the Grid to be on the left and the template columns on the right
ASKER CERTIFIED SOLUTION
Avatar of Deja Anbu
Deja Anbu
Flag of Oman image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks