473,387 Members | 1,641 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,387 software developers and data experts.

Another easy one: make a column into a hyperlink.

I have an asp.net page that has a datagrid on it. The datagrid is populated
at runtime from Active Directory.

I need to set one of the columns as a hyperlink while appending a mailto to
the data within that particular column's cell.

That is, if the column is named 'Email' and one of the rows is
'g************@home.com' I need to be able to click on
ge***********@home.com and it will invoke a 'mailto:ge***********@home.com'
as a hyperlink.

Thoughts?

Thanks in advance,

Jay
Nov 18 '05 #1
3 1109
Well I know that in design mode you can format an item cell in the datagrid. So, to my knowledge what ever you can do in design mode, you can do through code. But, this may take a little more patience to do. I am intrested to see how this can be done as well

"Jason" wrote:
I have an asp.net page that has a datagrid on it. The datagrid is populated
at runtime from Active Directory.

I need to set one of the columns as a hyperlink while appending a mailto to
the data within that particular column's cell.

That is, if the column is named 'Email' and one of the rows is
'g************@home.com' I need to be able to click on
ge***********@home.com and it will invoke a 'mailto:ge***********@home.com'
as a hyperlink.

Thoughts?

Thanks in advance,

Jay

Nov 18 '05 #2
lookup the hyperlinkcolumn

<asp:DataGrid id="ContainerID" runat="server" autogeneratecolumns="false" >
<columns>
<asp:HyperLinkColumn
DataTextField="Email"
HeaderText="Email"
DataNavigateUrlFormatString="mailto:{0}"
DataNavigateUrlField="EmailField" />
</columns>
</asp:DataGrid>

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Jason" <ja***@grossmans.net> wrote in message
news:e#*************@TK2MSFTNGP12.phx.gbl...
I have an asp.net page that has a datagrid on it. The datagrid is populated at runtime from Active Directory.

I need to set one of the columns as a hyperlink while appending a mailto to the data within that particular column's cell.

That is, if the column is named 'Email' and one of the rows is
'g************@home.com' I need to be able to click on
ge***********@home.com and it will invoke a 'mailto:ge***********@home.com' as a hyperlink.

Thoughts?

Thanks in advance,

Jay

Nov 18 '05 #3
It was the DataTextField="Email" I was missing to specify an existing data
column rather than creating a new one. Works like a charm.

Thanks a million John.

"John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message
news:Oh**************@TK2MSFTNGP12.phx.gbl...
lookup the hyperlinkcolumn

<asp:DataGrid id="ContainerID" runat="server" autogeneratecolumns="false"

<columns>
<asp:HyperLinkColumn
DataTextField="Email"
HeaderText="Email"
DataNavigateUrlFormatString="mailto:{0}"
DataNavigateUrlField="EmailField" />
</columns>
</asp:DataGrid>

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Jason" <ja***@grossmans.net> wrote in message
news:e#*************@TK2MSFTNGP12.phx.gbl...
I have an asp.net page that has a datagrid on it. The datagrid is

populated
at runtime from Active Directory.

I need to set one of the columns as a hyperlink while appending a mailto

to
the data within that particular column's cell.

That is, if the column is named 'Email' and one of the rows is
'g************@home.com' I need to be able to click on
ge***********@home.com and it will invoke a

'mailto:ge***********@home.com'
as a hyperlink.

Thoughts?

Thanks in advance,

Jay


Nov 18 '05 #4

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

Similar topics

0
by: Mo | last post by:
On one webpage I have a datagrid which is filled when the user selects some search criteria (e.g. surname or DoB) in different text fields and clicks on a button control. The datagrid also...
2
by: Ravikanth[MVP] | last post by:
Hi asp:DataGrid id="YourID" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="Sample Column"> <ItemTemplate> <asp:Hyperlink runat="server" Text='<%...
9
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring =...
1
by: D. Shane Fowlkes | last post by:
Hello All. I keep asking for help with this on the www.asp.net forums and nobody seems to be able to help. What I'm trying to accomplish is very simple. I simply want to create a Hyperlink...
3
by: Tim::.. | last post by:
I currently have the following datagrid but want to turn the name and email column into a hyperlink in the codebehind! Can someone please tell me how I achieve this! Thanks Private Sub...
2
by: Jason | last post by:
I have a data grid with a hyperlink column. The hyperlink is created by a class that extracts the link from an XML Document. How can I populate the hyperlink column in the data grid with the...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.