Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

hyperlink column in my gridview

Posted on 2010-09-02
3
Medium Priority
?
765 Views
Last Modified: 2012-05-10
I have grid view in which I want the last column to be a hyperlink. and the querystring for that link is the going to be the value of the first column of the gridview.  so the link should be something like
service.aspx?service="whatever the value is from the first column". the text of that hyperlink should be "View". How can I accomplish this?


I am populatating the grid by creating a datatable in my code and then binding the grid with that datatable.
<asp:BoundField DataField="servicename" HeaderText="Service" />
<asp:BoundField DataField="New" HeaderText="New" />
<asp:BoundField DataField="Old_Amount" HeaderText="Old Budget" />
<asp:BoundField DataField="New_Amount" HeaderText="New Budget" />
<asp:BoundField DataField="Difference" HeaderText="Difference" />
<asp:BoundField HeaderText="Notes/Attachments" />
<asp:HyperLinkField Text should be "View" url should be \service.aspx?servicename= value from the first column/>

Open in new window

0
Comment
Question by:pratikshahse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
OBonio earned 1000 total points
ID: 33588992
Something like this :

<asp:HyperLinkField Text="View" DataNavigateUrlFields="servicename" DataNavigateUrlFormatString="service.aspx?service={0}" />
0
 
LVL 6

Assisted Solution

by:nipunu
nipunu earned 1000 total points
ID: 33594576
<asp:hyperlinkfield headertext="View"  datatextfield="View" datanavigateurlfields="servicename"
      datanavigateurlformatstring="service.aspx?service={0}" />

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question