I am sorry ,but I should state why I asked the above question.It was because I see some statement
int the <<ASP.NET 2.0 MVP Hacks and Tips>> book.In the section "Adding Client-Side Script to the GridView Control"
of chapter 7.It says these words:
Quote:
quote:
Code:
You can't use RowCreated to add a client-side script to the GridView control to get the value
from a column located in the selected row because the created row's cells haven't been data-bound
when the event is triggered. Instead, use the RowDataBound event. The following example gets
the value from the second cell of a row when the row is selected by pressing the left
mouse button on a row:
void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.Cells != null && e.Row.Cells.Count > 1)
{
e.Row.Attributes.Add("onClick", "alert('Selected value: " +
e.Row.Cells[1].Text + "')");
}
}
|
So now I am completely confuse.could you explain it more clear for me?
Thanks.
------------------------------------------------------------------------
We learn from the history that we do not learn from the history