How to add an hyperlick column to grid view

Discussion in 'ASP .Net' started by Valli, Sep 25, 2007.

  1. Valli

    Valli Guest

    Hi,

    I am using a gridview to display data from table. In the gridview, there
    are 5 columns in which one column contains link name(eg.
    http://www.msn.com).
    I want to show this link as an hyperlink & when the user click the link,
    the browser should open the link page.
    Can anyone explain how to add an hyperlink column & when it got clicked
    it should get transferered to the selected web page.
    The link page differs for each record in grid view.

    I am new to ASP. Please help me in this...

    Regards
    Valli
    Valli, Sep 25, 2007
    #1
    1. Advertising

  2. Hello Valli,

    Just add a hyperlink control. You can edit the standard gridview template
    http://authors.aspalliance.com/aspxtreme/webforms/controls/addinghyperlinkfieldstogridview.aspx

    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    V> Hi,
    V>
    V> I am using a gridview to display data from table. In the
    V> gridview, there
    V> are 5 columns in which one column contains link name(eg.
    V> http://www.msn.com).
    V> I want to show this link as an hyperlink & when the user click
    V> the link,
    V> the browser should open the link page.
    V> Can anyone explain how to add an hyperlink column & when it got
    V> clicked
    V> it should get transferered to the selected web page.
    V> The link page differs for each record in grid view.
    V> I am new to ASP. Please help me in this...
    V>
    V> Regards
    V> Valli
    Michael Nemtsev, MVP, Sep 25, 2007
    #2
    1. Advertising

  3. You can add a TemplateField in the GridView control using the Edit Column
    option from the context menu when you click on the smart tag (arrow on top og
    the Grid).

    1. Add a TemplateField in the Selected Fields list.

    2. Now Right click on the Grid and select Edit Templates. Now drop the
    Hyperlink control in the ItemTemplate of the Grid.

    3. Now bind the NavigateURL and Text property of the Hyperlink to the
    hyperlink column field in the table using Data Bindings.

    4. Now if you click on the hyperlink, it will take you to that page.

    Regards,
    Manish

    "Valli" wrote:

    > Hi,
    >
    > I am using a gridview to display data from table. In the gridview, there
    > are 5 columns in which one column contains link name(eg.
    > http://www.msn.com).
    > I want to show this link as an hyperlink & when the user click the link,
    > the browser should open the link page.
    > Can anyone explain how to add an hyperlink column & when it got clicked
    > it should get transferered to the selected web page.
    > The link page differs for each record in grid view.
    >
    > I am new to ASP. Please help me in this...
    >
    > Regards
    > Valli
    >
    >
    >
    =?Utf-8?B?TWFuaXNo?=, Sep 25, 2007
    #3
    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. Fernando Lopes

    Add a radio button column in a grid view

    Fernando Lopes, Dec 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,869
    Fernando Lopes
    Dec 7, 2004
  2. Luqman
    Replies:
    2
    Views:
    3,795
    Luqman
    Feb 1, 2006
  3. parez
    Replies:
    1
    Views:
    740
    parez
    Jul 19, 2006
  4. wahtnamas
    Replies:
    0
    Views:
    880
    wahtnamas
    May 1, 2009
  5. Parthiv Joshi
    Replies:
    1
    Views:
    649
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page