C# .NET - Add hyperlink to listview - Asked By Dev - on 24-Feb-07 01:06 AM

How to add a hyperlink button or button to a listview.

thanks and regards


add button to a listview - K Pravin Kumar Reddy replied to Dev - on 24-Feb-07 04:59 AM

add button to a listview


adding a hyperlink in a listview


Hyperlink in Listview - SP replied to Dev - on 25-Sep-08 01:06 AM

you can use the HitTest method inside the SelectedIndexChanged event:


This will tell you which sub item has been clicked.

Hope this helps.

rtetrr replied to K Pravin Kumar Reddy on 22-Apr-10 02:04 PM
You are a retard.
That's not C#. And the author states that it doesn't work. gtfo
Andrew replied to rtetrr on 15-Jun-10 02:36 PM
Not to kick a dead horse, but that link works perfectly fine.  Any programmer worth his own salt should be able to read other programming languages.

Example:  I program primarily in C/C++ and C#, but I can read VB, Python, Perl, etc. etc...

And since VB uses .NET, the exact same principles used there can be used in C#.  If anything, it gives you a good place to start.  I appreciate the answer given as it worked great for me.
idm India replied to Andrew on 06-Aug-11 07:37 AM
Use this code  in your list view to make Hyperlink Button

<asp:HyperLink ID="HyperLink2" runat="server"
  NavigateUrl='<%#Eval("Keywords_1","~/search.aspx?q={0}") %>' title='<%# Eval("Keywords_1") %>' Text='<%# Eval("Keywords_1") %>' Target="_blank" ></asp:HyperLink>,