我需要以编程方式更改GridView内Label的值。GridView事件RowCreated它发生在控件的渲染后?
我使用此代码但不起作用。我无法找到控制。
- 我的问题是_RowCreated事件在呈现控件之前触发?
- 如果是,我应该使用哪个事件?
感谢
protected void uxListAuthorsDisplayer_RowCreated(object sender, GridViewRowEventArgs e)
{
int myRowIndex = e.Row.RowIndex;
//Label myLabel = (Label)e.Row[myRowIndex].FindControl("uxUserIdDisplayer");
if (myRowIndex >= 0)
{
//e.Row.Cells[3].Text = "Ciao";
Label myLabel = (Label)e.Row.FindControl("uxUserIdDisplayer");
myLabel.Text = "TEST";
}
}