473,326 Members | 2,173 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,326 software developers and data experts.

link on datagrid

I have a datagrid bound to a datareader. One of the columns contains file
name. I would like a column which acts as a link and opens a link to the
file (normally a pdf). How would I do this?
Nov 19 '05 #1
6 2410
You need to make a template column with a hyperlink control in item template
and databind the hyperlink to the name column.

Eliyahu

"Chris Kennedy" <ch**********@cybase.co.uk> wrote in message
news:Og**************@TK2MSFTNGP12.phx.gbl...
I have a datagrid bound to a datareader. One of the columns contains file
name. I would like a column which acts as a link and opens a link to the
file (normally a pdf). How would I do this?

Nov 19 '05 #2
Eliyahu Goldin wrote:
You need to make a template column with a hyperlink control in item
template and databind the hyperlink to the name column.

Eliyahu


Or, even simpler, you could add a hyperlinkcolumn, and
set the DataTextField and DataNavigateUrlField properties
to the file name column.

--

Riki
Nov 19 '05 #3
How do I set them?

"Riki" <ri**@nospam.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Eliyahu Goldin wrote:
You need to make a template column with a hyperlink control in item
template and databind the hyperlink to the name column.

Eliyahu


Or, even simpler, you could add a hyperlinkcolumn, and
set the DataTextField and DataNavigateUrlField properties
to the file name column.

--

Riki

Nov 19 '05 #4
Soory I'll be more specific. How do I do this in handwritten asp.net code
rather than in Visual Studio.

"Chris Kennedy" <ch**********@cybase.co.uk> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
How do I set them?

"Riki" <ri**@nospam.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Eliyahu Goldin wrote:
You need to make a template column with a hyperlink control in item
template and databind the hyperlink to the name column.

Eliyahu


Or, even simpler, you could add a hyperlinkcolumn, and
set the DataTextField and DataNavigateUrlField properties
to the file name column.

--

Riki


Nov 19 '05 #5
The quickstart tutorials at www.asp.net will tell you exactly how to do
this. Look under "Web Controls Syntax Reference", section DataGrid.

HTH,
Premier JiangZemin

"Chris Kennedy" <ch**********@cybase.co.uk> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Soory I'll be more specific. How do I do this in handwritten asp.net code
rather than in Visual Studio.

"Chris Kennedy" <ch**********@cybase.co.uk> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
How do I set them?

"Riki" <ri**@nospam.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Eliyahu Goldin wrote:
You need to make a template column with a hyperlink control in item
template and databind the hyperlink to the name column.

Eliyahu

Or, even simpler, you could add a hyperlinkcolumn, and
set the DataTextField and DataNavigateUrlField properties
to the file name column.

--

Riki



Nov 19 '05 #6
<asp:HyperLinkColumn DataNavigateUrlField="myUrlField" DataTextField="Name"
HeaderText="URL"></asp:HyperLinkColumn>

Riki

"Chris Kennedy" <ch**********@cybase.co.uk> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Soory I'll be more specific. How do I do this in handwritten asp.net code
rather than in Visual Studio.

Or, even simpler, you could add a hyperlinkcolumn, and
set the DataTextField and DataNavigateUrlField properties
to the file name column.


Nov 19 '05 #7

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.