Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink

Reply
Thread Tools

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

 
 
davetichenor
Guest
Posts: n/a
 
      10-30-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
 
      10-30-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

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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 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
HyperLink Column and Button Column in a DataGrid =?Utf-8?B?V2FyYW4=?= ASP .Net 0 08-09-2005 12:00 AM
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



Advertisments