Murray Brown
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,GridViewRo w).RowInde x %>"
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,GridViewRo w).RowInde x %>"
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,GridViewRo w).RowInde x %>"
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,GridViewRo w).RowInde x %>"
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,GridViewRo w).RowInde x %>"
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" />
<SortedAscendingHeaderStyl e BackColor="#0D4AC4" />
<SortedDescendingCellStyle BackColor="#D6DFDF" />
<SortedDescendingHeaderSty le BackColor="#002876" />
</asp:GridView>
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,GridViewRo
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,GridViewRo
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,GridViewRo
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,GridViewRo
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,GridViewRo
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" />
<SortedAscendingHeaderStyl
<SortedDescendingCellStyle
<SortedDescendingHeaderSty
</asp:GridView>
Do you mean you want to show the grid on the right hand side in its container control?
ASKER
I want the Grid to be on the left and the template columns on the right
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks