link on datagrid

Discussion in 'ASP .Net' started by Chris Kennedy, Mar 21, 2005.

  1. I have a datagrid bound to a datareader. One of the columns contains file
    name. I would like a column which acts as a link and opens a link to the
    file (normally a pdf). How would I do this?
    Chris Kennedy, Mar 21, 2005
    #1
    1. Advertising

  2. You need to make a template column with a hyperlink control in item template
    and databind the hyperlink to the name column.

    Eliyahu

    "Chris Kennedy" <> wrote in message
    news:...
    > I have a datagrid bound to a datareader. One of the columns contains file
    > name. I would like a column which acts as a link and opens a link to the
    > file (normally a pdf). How would I do this?
    >
    >
    Eliyahu Goldin, Mar 21, 2005
    #2
    1. Advertising

  3. Chris Kennedy

    Riki Guest

    Eliyahu Goldin wrote:
    > You need to make a template column with a hyperlink control in item
    > template and databind the hyperlink to the name column.
    >
    > Eliyahu


    Or, even simpler, you could add a hyperlinkcolumn, and
    set the DataTextField and DataNavigateUrlField properties
    to the file name column.

    --

    Riki
    Riki, Mar 21, 2005
    #3
  4. How do I set them?

    "Riki" <> wrote in message
    news:...
    > Eliyahu Goldin wrote:
    >> You need to make a template column with a hyperlink control in item
    >> template and databind the hyperlink to the name column.
    >>
    >> Eliyahu

    >
    > Or, even simpler, you could add a hyperlinkcolumn, and
    > set the DataTextField and DataNavigateUrlField properties
    > to the file name column.
    >
    > --
    >
    > Riki
    >
    Chris Kennedy, Mar 21, 2005
    #4
  5. Soory I'll be more specific. How do I do this in handwritten asp.net code
    rather than in Visual Studio.

    "Chris Kennedy" <> wrote in message
    news:...
    > How do I set them?
    >
    > "Riki" <> wrote in message
    > news:...
    >> Eliyahu Goldin wrote:
    >>> You need to make a template column with a hyperlink control in item
    >>> template and databind the hyperlink to the name column.
    >>>
    >>> Eliyahu

    >>
    >> Or, even simpler, you could add a hyperlinkcolumn, and
    >> set the DataTextField and DataNavigateUrlField properties
    >> to the file name column.
    >>
    >> --
    >>
    >> Riki
    >>

    >
    >
    Chris Kennedy, Mar 21, 2005
    #5
  6. Chris Kennedy

    JiangZemin Guest

    The quickstart tutorials at www.asp.net will tell you exactly how to do
    this. Look under "Web Controls Syntax Reference", section DataGrid.

    HTH,
    Premier JiangZemin

    "Chris Kennedy" <> wrote in message
    news:%232a%...
    > Soory I'll be more specific. How do I do this in handwritten asp.net code
    > rather than in Visual Studio.
    >
    > "Chris Kennedy" <> wrote in message
    > news:...
    >> How do I set them?
    >>
    >> "Riki" <> wrote in message
    >> news:...
    >>> Eliyahu Goldin wrote:
    >>>> You need to make a template column with a hyperlink control in item
    >>>> template and databind the hyperlink to the name column.
    >>>>
    >>>> Eliyahu
    >>>
    >>> Or, even simpler, you could add a hyperlinkcolumn, and
    >>> set the DataTextField and DataNavigateUrlField properties
    >>> to the file name column.
    >>>
    >>> --
    >>>
    >>> Riki
    >>>

    >>
    >>

    >
    >
    JiangZemin, Mar 22, 2005
    #6
  7. Chris Kennedy

    Riki Guest

    <asp:HyperLinkColumn DataNavigateUrlField="myUrlField" DataTextField="Name"
    HeaderText="URL"></asp:HyperLinkColumn>

    Riki

    "Chris Kennedy" <> wrote in message
    news:%232a%...
    > Soory I'll be more specific. How do I do this in handwritten asp.net code
    > rather than in Visual Studio.


    > >> Or, even simpler, you could add a hyperlinkcolumn, and
    > >> set the DataTextField and DataNavigateUrlField properties
    > >> to the file name column.
    Riki, Mar 22, 2005
    #7
    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:
    795
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    443
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    412
  4. kolesdz
    Replies:
    9
    Views:
    519
    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:
    105
    Marina Limeira
    Feb 7, 2006
Loading...

Share This Page