473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Link in a DataGrid

Hi,

I've got a DataGrid displaying ID, Name, Email and Notes field from a
table. Now I'd like to put a Hyperlink under the value in the
name-column (or, if possible, under the complete row) which will point
to a details-page with the value from the ID field built into the link.

Sample:
ID|Name|Email|Notes
213|Peter Parker|peteratspidernetdotcom|be brave
214|Robin Hood|robinatsherwooddotcom|be smart

The Links id like to build should look somewhat like
"herodetails.aspx?id=213".

Could somebody point me into the righ direction? Thanks in advance!

--
/Matthias
Nov 19 '05 #1
2 891
You'll need a HyperLinkColumn instead of a BoundColumn for your name column:

<asp:HyperLinkColumn DataTextField="NameColumn" DataNavigateUrlField="IDColumn"
DataNavigateUrlFormatString="Details.aspx?ID={0}"> </asp:HyperLinkColumn>

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've got a DataGrid displaying ID, Name, Email and Notes field from a
table. Now I'd like to put a Hyperlink under the value in the
name-column (or, if possible, under the complete row) which will point
to a details-page with the value from the ID field built into the
link.

Sample:
ID|Name|Email|Notes
213|Peter Parker|peteratspidernetdotcom|be brave
214|Robin Hood|robinatsherwooddotcom|be smart
The Links id like to build should look somewhat like
"herodetails.aspx?id=213".

Could somebody point me into the righ direction? Thanks in advance!


Nov 19 '05 #2
Thanks Brock, that helped.

Matthias

Brock Allen wrote:
You'll need a HyperLinkColumn instead of a BoundColumn for your name
column:

<asp:HyperLinkColumn DataTextField="NameColumn"
DataNavigateUrlField="IDColumn"
DataNavigateUrlFormatString="Details.aspx?ID={0}"> </asp:HyperLinkColumn>

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've got a DataGrid displaying ID, Name, Email and Notes field from a
table. Now I'd like to put a Hyperlink under the value in the
name-column (or, if possible, under the complete row) which will point
to a details-page with the value from the ID field built into the
link.

Sample:
ID|Name|Email|Notes
213|Peter Parker|peteratspidernetdotcom|be brave
214|Robin Hood|robinatsherwooddotcom|be smart
The Links id like to build should look somewhat like
"herodetails.aspx?id=213".

Could somebody point me into the righ direction? Thanks in advance!



--
/Matthias
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: scott | last post by:
Hi all First off, thank you for any one that can help. I have a problem trying to link a DataGrideTableStyle to a DataGrid. I have a dataset which reads from a file a xml schema and a xml...
3
by: Raymond Lewallen | last post by:
I have a modal dialog displaying a datagrid control. Click on the column header to sort the datagrid opens a new window with the following in the location: ...
2
by: Luis E Valencia | last post by:
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid the link would be accoiones.aspx?iddireccion=2&idindicador=5 I tried...
0
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As...
5
by: Luis E Valencia | last post by:
I need a link on a datagrid, the link must have fields of the database Like this acciones.aspx?iddireccion=1&idindicador=4 Thanks
2
by: JenHu | last post by:
hi, I have a datagrid in my asp.net application, I am using vb.net language. I want to have my last column as a link column, link to text file. The link path is "c:\Temp\" & F_File_Name, which...
2
by: Its_Me_SunnY | last post by:
Hi, can any one help me how to make a cell in data grid link to another page.... like i have a field "refno" in my table so when in get the values from table to datagrid the refno's of every...
2
by: pradeep_TP | last post by:
Hello world, I have a simple datagrid on asp.net web form , in which I am showing a single button column called EDIT. The code in the .aspx files for the same is as below. ...
7
by: Alex Maghen | last post by:
I have a DataGrid where all the columns can be clicked to sort by that column. A very strange thing is happening: When the page is first displayed with my default sort order, a click on one of...
1
by: VanZandt | last post by:
I have a class(dll) that extends winform datagrid to provide link column in vb.net. I have managed to create a datagrid in c# winforms that shows link in one of the column but when I try to create a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.