Link in a DataGrid

Discussion in 'ASP .Net' started by Matthias S., Mar 23, 2005.

  1. Matthias S.

    Matthias S. Guest

    Hi,

    I've got a DataGrid displaying ID, Name, Email and Notes field from a
    table. Now I'd like to put a Hyperlink under the value in the
    name-column (or, if possible, under the complete row) which will point
    to a details-page with the value from the ID field built into the link.

    Sample:
    ID|Name|Email|Notes
    213|Peter Parker|peteratspidernetdotcom|be brave
    214|Robin Hood|robinatsherwooddotcom|be smart

    The Links id like to build should look somewhat like
    "herodetails.aspx?id=213".

    Could somebody point me into the righ direction? Thanks in advance!

    --
    /Matthias
     
    Matthias S., Mar 23, 2005
    #1
    1. Advertising

  2. Matthias S.

    Brock Allen Guest

    You'll need a HyperLinkColumn instead of a BoundColumn for your name column:

    <asp:HyperLinkColumn DataTextField="NameColumn" DataNavigateUrlField="IDColumn"
    DataNavigateUrlFormatString="Details.aspx?ID={0}"></asp:HyperLinkColumn>

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Hi,
    >
    > I've got a DataGrid displaying ID, Name, Email and Notes field from a
    > table. Now I'd like to put a Hyperlink under the value in the
    > name-column (or, if possible, under the complete row) which will point
    > to a details-page with the value from the ID field built into the
    > link.
    >
    > Sample:
    > ID|Name|Email|Notes
    > 213|Peter Parker|peteratspidernetdotcom|be brave
    > 214|Robin Hood|robinatsherwooddotcom|be smart
    > The Links id like to build should look somewhat like
    > "herodetails.aspx?id=213".
    >
    > Could somebody point me into the righ direction? Thanks in advance!
    >
     
    Brock Allen, Mar 23, 2005
    #2
    1. Advertising

  3. Matthias S.

    Matthias S. Guest

    Thanks Brock, that helped.

    Matthias

    Brock Allen wrote:
    > You'll need a HyperLinkColumn instead of a BoundColumn for your name
    > column:
    >
    > <asp:HyperLinkColumn DataTextField="NameColumn"
    > DataNavigateUrlField="IDColumn"
    > DataNavigateUrlFormatString="Details.aspx?ID={0}"></asp:HyperLinkColumn>
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> Hi,
    >>
    >> I've got a DataGrid displaying ID, Name, Email and Notes field from a
    >> table. Now I'd like to put a Hyperlink under the value in the
    >> name-column (or, if possible, under the complete row) which will point
    >> to a details-page with the value from the ID field built into the
    >> link.
    >>
    >> Sample:
    >> ID|Name|Email|Notes
    >> 213|Peter Parker|peteratspidernetdotcom|be brave
    >> 214|Robin Hood|robinatsherwooddotcom|be smart
    >> The Links id like to build should look somewhat like
    >> "herodetails.aspx?id=213".
    >>
    >> Could somebody point me into the righ direction? Thanks in advance!
    >>

    >
    >
    >


    --
    /Matthias
     
    Matthias S., Mar 23, 2005
    #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. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    881
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    478
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    434
  4. kolesdz
    Replies:
    9
    Views:
    542
    Blinky the Shark
    Aug 22, 2007
  5. Marina Limeira

    LINK with another link

    Marina Limeira, Feb 7, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    121
    Marina Limeira
    Feb 7, 2006
Loading...

Share This Page