动态改变GridView中EmptyDataTemplate的值

 

    // 根据查询条件,更换Empty提示
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        
if (e.Row.RowType == DataControlRowType.EmptyDataRow)
        {

            Label lblEmptyShow 
= (Label)GridView1.Controls[0].Controls[0].FindControl("lblEmptyShow");  //第一层Control是Table,第二层Control是Row
            lblEmptyShow.Text = "Sorry, there are no new leaveword now.";
        }
    }

posted on 2009-02-13 14:54  王培  阅读(255)  评论(0编辑  收藏  举报

导航