HyperLink Column URGENT!!!

Discussion in 'ASP .Net Web Controls' started by Christopher Calhoun, Jan 19, 2004.

  1. Does anyone Know how to programmatically assign all the columns in a
    DataGrid with AutoGenerateColumns set to true as Hyperlink Columns?

    Thanks in Advance....
    Christopher Calhoun, Jan 19, 2004
    #1
    1. Advertising

  2. Christopher Calhoun

    Alvin Bruney Guest

    You can't really assign them because they aren't template columns. You would
    need to write your code into the itemcreated or itemdatabound event handler
    to add a control into the appropriate cell
    Here is an approach in the itemdatabound event handler

    if(e.item.listitem == listitemtype.item)
    {
    HyperLink tb = new HyperLink();

    tb.ForeColor = Color.Blue;

    tb.Text = "Invalid";

    tb.Font.Size = FontUnit.XXSmall;

    tb.NavigateUrl = "Invalid.aspx";

    e.Item.Controls[e.Item.Cells.Count - 1].Controls.Add(tb);

    tb = null;

    }

    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "Christopher Calhoun" <> wrote in message
    news:...
    > Does anyone Know how to programmatically assign all the columns in a
    > DataGrid with AutoGenerateColumns set to true as Hyperlink Columns?
    >
    > Thanks in Advance....
    >
    >
    Alvin Bruney, Jan 19, 2004
    #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:
    600
    =?Utf-8?B?V2FyYW4=?=
    Aug 9, 2005
  2. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    11
    Views:
    1,009
    deandany
    Jul 17, 2006
  3. davetichenor
    Replies:
    1
    Views:
    819
    Eliyahu Goldin
    Oct 30, 2006
  4. Christopher Calhoun

    Hyperlink Column URGENT!!!

    Christopher Calhoun, Jan 19, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    106
    Ken Cox [Microsoft MVP]
    Jan 26, 2004
  5. Dave
    Replies:
    0
    Views:
    935
Loading...

Share This Page