change datagrid column to hyperlink

Discussion in 'ASP .Net' started by Claire Reed, Aug 4, 2003.

  1. Claire Reed

    Claire Reed Guest

    Hi All,

    I have a datagrid and am autogenerating columns. I would like one of
    the columns to be a hyperlink column after the data has been bound
    i.e. I already have a column with the data in it (a name) and I want
    it to be converted to a hyperlink. Is it possible to do this at
    runtime?

    thanks

    Claire
     
    Claire Reed, Aug 4, 2003
    #1
    1. Advertising

  2. Claire Reed

    Marina Guest

    I don't think you can do this with columns generated at runtime.

    What you can do, is have sql like: select '<a href="' + MyUrlColumn + '">'
    + MyUrlColumn + '</a>' as 'The Link' from MyTable

    This basically builds an <a> link in the SQL itself, and since the datagrid
    treats and text as HTML, this will display a link.

    "Claire Reed" <> wrote in message
    news:...
    > Hi All,
    >
    > I have a datagrid and am autogenerating columns. I would like one of
    > the columns to be a hyperlink column after the data has been bound
    > i.e. I already have a column with the data in it (a name) and I want
    > it to be converted to a hyperlink. Is it possible to do this at
    > runtime?
    >
    > thanks
    >
    > Claire
     
    Marina, Aug 4, 2003
    #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. Robbo
    Replies:
    1
    Views:
    4,211
    Rick Strahl [MVP]
    Oct 18, 2003
  2. =?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
  3. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    11
    Views:
    1,010
    deandany
    Jul 17, 2006
  4. davetichenor
    Replies:
    1
    Views:
    841
    Eliyahu Goldin
    Oct 30, 2006
  5. Dave
    Replies:
    0
    Views:
    954
Loading...

Share This Page