Adding Template fields dynamically at Grid_InitializeRow event

2 replies. Last post: October 14, 2009 1:08 AM by Abdullah Foysal
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I want to modify a cell value at runtime. Suppose I have column which shows the price of a product and link that will open details of that product as popup. It will be exactly as follows:

$9.99 Detail

Internal code will look like:

$9.99 <a href='#' onclick='javascript:popUpWindow();'>Details</a>


I want to do this task in Grid_InitializeRow event. Something like bellow:

if(e.Row.Type == RowType.Record)
{
if(e.Row.Cells.GetNamedItem("Price") != null)
{
e.Row.Cells.GetNamedItem("Price").Column.ColumnType = ColumnType.Template;

//I want to set my text and link values from here.

}
}

I have tried some ways but unable to add anything in this cell. How can I do it? Expecting some working code from anyone.


Thanks



All times are GMT -5. The time now is 11:47 PM.
Previous Next