Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Another easy one: make a column into a hyperlink.

Reply
Thread Tools

Another easy one: make a column into a hyperlink.

 
 
Jason
Guest
Posts: n/a
 
      07-28-2004
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
'(E-Mail Removed)' I need to be able to click on
http://www.velocityreviews.com/forums/(E-Mail Removed) and it will invoke a '(E-Mail Removed)'
as a hyperlink.

Thoughts?

Thanks in advance,

Jay


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
Guest
Posts: n/a
 
      07-28-2004
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
> '(E-Mail Removed)' I need to be able to click on
> (E-Mail Removed) and it will invoke a '(E-Mail Removed)'
> as a hyperlink.
>
> Thoughts?
>
> Thanks in advance,
>
> Jay
>
>
>

 
Reply With Quote
 
 
 
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      07-28-2004
lookup the hyperlinkcolumn

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

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP


"Jason" <(E-Mail Removed)> wrote in message
news:e#(E-Mail Removed)...
> 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
> '(E-Mail Removed)' I need to be able to click on
> (E-Mail Removed) and it will invoke a

'(E-Mail Removed)'
> as a hyperlink.
>
> Thoughts?
>
> Thanks in advance,
>
> Jay
>
>



 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      07-28-2004
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)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> lookup the hyperlinkcolumn
>
> <aspataGrid id="ContainerID" runat="server" autogeneratecolumns="false"
>
> <columns>
> <asp:HyperLinkColumn
> DataTextField="Email"
> HeaderText="Email"
> DataNavigateUrlFormatString="mailto:{0}"
> DataNavigateUrlField="EmailField" />
> </columns>
> </aspataGrid>
>
> --
> Regards
>
> John Timney
> Microsoft Regional Director
> Microsoft MVP
>
>
> "Jason" <(E-Mail Removed)> wrote in message
> news:e#(E-Mail Removed)...
> > 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
> > '(E-Mail Removed)' I need to be able to click on
> > (E-Mail Removed) and it will invoke a

> '(E-Mail Removed)'
> > as a hyperlink.
> >
> > Thoughts?
> >
> > Thanks in advance,
> >
> > Jay
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
Activa or not activate a button column depending if another data column has data or not carlos perez ASP .Net 0 06-08-2004 02:16 PM



Advertisments