J
JJ297
How do I move the select button to the last column in a gridview. I
read to use the Gridview1_PreRender control and do this but I can't
get it to work:
Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.PreRender
datacontrolfield temp = gridview1.Columns[0]
If (temp Is CommandField) Then
GridView1.Columns.RemoveAt(0)
GridView1.Columns.Insert(2, temp)
End If
End Sub
Here's my gridview:
<asp:GridView ID="GridView1" runat="server" Width="812px"
PageSize="100" DataKeyNames="TitleID"
BorderColor="#CFB37D" BorderStyle="Solid" Font-Bold="False"
Font-Names="Times New Roman"
ForeColor="Red" HorizontalAlign="Center" AllowPaging="True">
<Columns>
<asp:CommandField ShowSelectButton="True">
<ControlStyle ForeColor="Blue" />
<ItemStyle VerticalAlign="Top" />
</asp:CommandField>
</Columns>
</asp:GridView>
Any suggestions?
read to use the Gridview1_PreRender control and do this but I can't
get it to work:
Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.PreRender
datacontrolfield temp = gridview1.Columns[0]
If (temp Is CommandField) Then
GridView1.Columns.RemoveAt(0)
GridView1.Columns.Insert(2, temp)
End If
End Sub
Here's my gridview:
<asp:GridView ID="GridView1" runat="server" Width="812px"
PageSize="100" DataKeyNames="TitleID"
BorderColor="#CFB37D" BorderStyle="Solid" Font-Bold="False"
Font-Names="Times New Roman"
ForeColor="Red" HorizontalAlign="Center" AllowPaging="True">
<Columns>
<asp:CommandField ShowSelectButton="True">
<ControlStyle ForeColor="Blue" />
<ItemStyle VerticalAlign="Top" />
</asp:CommandField>
</Columns>
</asp:GridView>
Any suggestions?