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

  • Thread starter Thread starter davetichenor
  • Start date Start date
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
 
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.
 
Back
Top