Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Link in a DataGrid

Reply
Thread Tools

Link in a DataGrid

 
 
Matthias S.
Guest
Posts: n/a
 
      03-23-2005
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
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      03-23-2005
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!
>




 
Reply With Quote
 
 
 
 
Matthias S.
Guest
Posts: n/a
 
      03-23-2005
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
 
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
Is D-Link DSL-604T same as D-Link DSL-604+ ? norm Wireless Networking 6 11-18-2005 10:25 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
D-LINK DWL-AG650 doesn't work with WinXP - Zero Configuration Service (WZCSVC) / D-Link AirXpert nearly works Johannes Rosenstock Wireless Networking 0 08-27-2004 11:49 PM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments