PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink

 
 
davetichenor
Guest
Posts: n/a
 
      30th Oct 2006
I have a column which has either "Yes" or "No" as the data - I want only the
"No"'s values to be a Hyperlink -

Clicking "No" would then take then to hyperlink - along with member's
membership ID (which is another column in the datagrid).

Hyperlink = ../Cardio.aspx?OMEMBID={0}

Any assistance would be nice.

thanks

Dave






 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      30th Oct 2006
Dave,

Make an ItemTemplate consisting of a link and a label. Handle RowDataBound
(ItemDataBound in 1.1) event. In the event use Item.DataItem property to
check the column value. If it is "Yes", show the label and hide the link. If
it is "No", hide the label, set the link's url and show the link.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


"davetichenor" <(E-Mail Removed)> wrote in message
news:OCZ5rID$(E-Mail Removed)...
>I have a column which has either "Yes" or "No" as the data - I want only
>the
> "No"'s values to be a Hyperlink -
>
> Clicking "No" would then take then to hyperlink - along with member's
> membership ID (which is another column in the datagrid).
>
> Hyperlink = ../Cardio.aspx?OMEMBID={0}
>
> Any assistance would be nice.
>
> thanks
>
> Dave
>
>
>
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
HyperLink Column in DataGrid Samuel Shulman Microsoft ASP .NET 4 8th Dec 2006 12:10 AM
Hyperlink column in a datagrid =?Utf-8?B?TWFubnkgQ2hvaGFu?= Microsoft ASP .NET 0 1st Nov 2004 10:24 PM
Need help with Hyperlink Column in DataGrid! Jack Black Microsoft ASP .NET 2 11th Sep 2004 12:18 AM
Hyperlink column in a datagrid Ravikanth[MVP] Microsoft ASP .NET 2 26th Aug 2003 07:12 PM
RE: DataGrid - HyperLink Column Pop-Up 臺灣微軟技術支援部 Microsoft ASP .NET 2 14th Aug 2003 01:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.