Hi, question about gridview sorting in VB.NET:
I have a gridview with autogenerate columns = true
<asp:GridView ID="GridView1" FooterStyle-BackColor="Aquamarine"
AutoGenerateColumns="true" AllowSorting="true" OnSorting="Gridview1_Sorting"
AllowPaging="True" PageSize="12" OnRowCreated="GridView1_RowCreated"
RowStyle-Wrap="true" runat="server" Width="100%" >
<HeaderStyle BackColor="#E0E0E0" ForeColor="#000000"/>
<FooterStyle BackColor="Aquamarine" />
<emptydatarowstyle backcolor="#CBE0FD" forecolor="#0000FF"/>
</asp:GridView>
I've declared the sort event handler (OnSorting="Gridview1_Sorting" ), and it works fine.
However, then I change the column title (headers as they are in the dataset which I get from the database)
GridView1.HeaderRow.Cells(0).Text = "Document" ' "PROC_UID" GridView1.HeaderRow.Cells(1).Text = "Process Step" ' "PROC_DOC_UID"
When I set the HeaderRow text, I can no longer click on the title to sort (it also is no longer underlined). How do I correct that?