GridView中的页脚模板 [英] Footer template in GridView
本文介绍了GridView中的页脚模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法在rowdatabound事件bt的页脚行中找到控件,因此跳过了条件...
I m unable to find control in footer row on rowdatabound event bt it skip the condition ...
protected void Page_Load(object sender, EventArgs e)
{
GridFill();
}
private void GridFill()
{
SqlDataAdapter adp=new SqlDataAdapter("select * from tbemp",con);
DataSet ds=new DataSet();
adp.Fill(ds);
GridView1.DataSource=ds;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)// here skip the if condition
{
TextBox tb1 = (TextBox)e.Row.FindControl("TextBox1");
}
}
推荐答案
尝试一下...
try this...
TextBox tb1 = GridView1.FooterRow.FindControl("TextBox1") as TextBox;
这篇关于GridView中的页脚模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文