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

Discussion in 'ASP .Net' started by davetichenor, Oct 30, 2006.

  1. davetichenor

    davetichenor Guest

    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
     
    davetichenor, Oct 30, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:OCZ5rID$...
    >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
    >
    >
    >
    >
    >
    >
     
    Eliyahu Goldin, Oct 30, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?V2FyYW4=?=

    HyperLink Column and Button Column in a DataGrid

    =?Utf-8?B?V2FyYW4=?=, Aug 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    604
    =?Utf-8?B?V2FyYW4=?=
    Aug 9, 2005
  2. Dave
    Replies:
    0
    Views:
    961
  3. Tim Chase
    Replies:
    7
    Views:
    295
    Dennis Lee Bieber
    Jul 20, 2012
  4. Peter Otten
    Replies:
    0
    Views:
    212
    Peter Otten
    Jul 19, 2012
  5. Tim Chase
    Replies:
    0
    Views:
    152
    Tim Chase
    Jul 19, 2012
Loading...

Share This Page