[RESOLVED] Can a gridview header column be a hyperlink?
Usually when you click the header of a gridview column it means you want to sort on that column. Can I instead have it be a hyperlink to another page? The reason I am asking is because I am converting an ASP page, and that is how it works there. Obiously it's not a gridview though. I was thinking of an alternative that's a button outside the gridview. The gridview shows statuses, such as Pending 3, and there is a status legend that explains what the statuses are. It is this legend I want to display when a user clicks the header. I suppose another alternative would be to put it in each cell, i.e. Pending, Closed, Active could all bring up the legend.
Your thoughts, please...
Re: Can a gridview header column be a hyperlink?
You can edit the HeaderTemplate for that column
It will look something like this:
Code:
<div>
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField HeaderText="test">
<HeaderTemplate>
<asp:HyperLink NavigateUrl="test.html" runat="server">Test</asp:HyperLink>
</HeaderTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
And have your .NET hyperlink point to a new window or however you want to work it.
Re: Can a gridview header column be a hyperlink?
Thank you so much!
And I was going to say, say hello to my friend Tom out there in Irvine, but then I remembered he lives in Trabuco Canyon now!
Re: [RESOLVED] Can a gridview header column be a hyperlink?