create a hyperlink?

F

Fetty

I have a dynamically created child grid inside of a grid. Each cell may or
may not have a date in it. How do I make that date a hyperlink? Eack column
has to have different links?
 
E

Elton Wang

Hi Fetty,

You can implement your logic in datagrid_ItemDataBound event

if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView)e.Item.DataItem; // data source as
dataset/datatable/dataview
HyperLink link = (HyperLink)e.Item.Cells[link_cell_index];
link.NavigateUrl = dynamicUrl(drv["data_field"]);

}

HTH

Elton Wang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top