how to use hyper columns in datagrid

Discussion in 'ASP .Net Datagrid Control' started by man, Apr 21, 2005.

  1. man

    man Guest

    man, Apr 21, 2005
    #1
    1. Advertising

  2. man

    Elton W Guest

    You can code in DataGrid_ItemDataBound event:

    if (e.Item.ItemType == ListItemType.Item ||
    e.Item.ItemType == ListItemType.AlternatingItem)
    {
    DataRowView drv = (DataRowView)e.Item.DataItem;
    HyperLink link = (HyperLink)e.Item.Cells
    [link_col_index].Controls[0];
    link.NavigateUrl = "http://localhost/content.aspx?
    key_word=" + drv["word"];

    }

    HTH

    Elton Wang



    >-----Original Message-----
    >I have set the configuration as the attchment jpg file
    >
    >however,when i click the hyper link , it only show the

    url as below:
    >http://localhost/content.aspx?key_word=
    >
    >even I have chosen the url field is "word" which is a

    data column in my
    >datagrid
    >
    >
    >And I want to url output as:
    >http://localhost/content.aspx?key_word=value
    >where value = the value of the word in the datagrid?
    >
    >thx you for your help
    >
    >
    >.
    >
    Elton W, Apr 21, 2005
    #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. Awah Teh

    Hyper-efficient Text Importing

    Awah Teh, Sep 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,156
    William Tasso
    Sep 3, 2003
  2. Meheraj shaik via .NET 247

    Hyper link in Datagrid

    Meheraj shaik via .NET 247, May 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,502
  3. k-re
    Replies:
    1
    Views:
    1,720
    Tim S.
    Jun 25, 2003
  4. Hyper Link in DataGrid

    , Mar 3, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    486
    Patrick.O.Ige
    Mar 3, 2006
  5. Alexander Kaplunov

    hyper link in DataGrid

    Alexander Kaplunov, Dec 17, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    181
    Alexander Kaplunov
    Dec 18, 2003
Loading...

Share This Page