Solved

hyperlink column in my gridview

Posted on 2010-09-02
3
762 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 250 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 250 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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

630 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