|
-
Aug 6th, 2009, 02:22 PM
#1
Thread Starter
PowerPoster
[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...
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Aug 6th, 2009, 02:42 PM
#2
Member
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.
-
Aug 6th, 2009, 03:00 PM
#3
Thread Starter
PowerPoster
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!
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Aug 6th, 2009, 03:01 PM
#4
Member
Re: [RESOLVED] Can a gridview header column be a hyperlink?
Haha, same thing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|