Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > how to use hyper columns in datagrid

Reply
Thread Tools

how to use hyper columns in datagrid

 
 
man
Guest
Posts: n/a
 
      04-21-2005
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


 
Reply With Quote
 
 
 
 
Elton W
Guest
Posts: n/a
 
      04-21-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)


>-----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
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Hyper link in Datagrid Meheraj shaik via .NET 247 ASP .Net 1 07-19-2005 10:36 AM
Binded Datagrid Formatting columns or hiding columns ton ASP .Net Web Controls 2 02-11-2004 04:09 AM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM
Re: Datagrid and hyper link question? k-re ASP .Net 1 06-25-2003 01:54 PM



Advertisments