Home All Groups Group Topic Archive Search About

how to use hyper columns in datagrid

Author
21 Apr 2005 3:36 PM
man
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

Author
21 Apr 2005 9:01 PM
Elton W
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
elton_w***@hotmail.com


>-----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
Show quoteHide quote
>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
>
>
>.
>