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

D

davetichenor

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
 
E

Eliyahu Goldin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top