日期:2014-05-18  浏览次数:20927 次

大家帮帮忙啊!急........
protected void gdView_RowDataBound(object sender, GridViewRowEventArgs e)
{
Label a=new Label();a.ID="a";a.Text="abc";
e.Row.Cells[0].Controls.Add(a);
}

为什么用gdViewRow.Rows[i].Cells[0].FindControl("a")找不到

------解决方案--------------------
C# code


protected void grd_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            DataRowView data = (DataRowView)e.Row.DataItem;
            Label lblInquiryDate = (Label)e.Row.FindControl("lblInquiryDate");
...
...

------解决方案--------------------
Up
------解决方案--------------------
好象 在gdView_RowCreated() 创建的