当我点击按钮C#时调用Gridview Rowdatabound [英] Call Gridview Rowdatabound When I Click On Button C#
本文介绍了当我点击按钮C#时调用Gridview Rowdatabound的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void ButtonAdd_Click(对象发件人,EventArgs e)
{
CalculateTotal();
// txttotwt_TextChanged(null,null);
AddNewRow();
gvMeatDispatch.RowDataBound + = new GridViewRowEventHandler(gvMeatDispatch_RowDataBound);
// ddlbranchdate_SelectedIndexChanged(this,EventArgs.Empty);
}
当我点击此代码时,我的rowdatabound事件未触发...请帮助我,如何在按钮点击中调用行数据绑定事件logic ..
解决方案
protected void ButtonAdd_Click( object sender,EventArgs e)
{
CalculateTotal();
// txttotwt_TextChanged(null,null);
AddNewRow();
// ddlbranchdate_SelectedIndexChanged(this,EventArgs.Empty);
gvMeatDispatch_RowDataBound( null , null );
}
现在它被解雇了......
Gird1_RowDataBound()menthod需要两个参数
1.Sender信息(发件人)
2.GridViewRowEventArgs(e)
你可以对这些对象进行初始化并调用menthod
Gird1_RowDataBound(发件人,e)
或
您可以通过发送空值直接调用它
Gird1_RowDataBound( null ,空跨度>)
protected void ButtonAdd_Click(object sender, EventArgs e)
{
CalculateTotal();
// txttotwt_TextChanged(null, null);
AddNewRow();
gvMeatDispatch.RowDataBound += new GridViewRowEventHandler(gvMeatDispatch_RowDataBound);
//ddlbranchdate_SelectedIndexChanged(this, EventArgs.Empty);
}
when i click this code,my rowdatabound event is not firing...please help me ,how to call row data bound event in button click logic..
解决方案
protected void ButtonAdd_Click(object sender, EventArgs e) { CalculateTotal(); // txttotwt_TextChanged(null, null); AddNewRow(); //ddlbranchdate_SelectedIndexChanged(this, EventArgs.Empty); gvMeatDispatch_RowDataBound(null, null); }
Now it's fired...
Gird1_RowDataBound() menthod takes two parameters
1.Sender info (Sender) 2.GridViewRowEventArgs (e)
you can intitialize those objects and call menthod
Gird1_RowDataBound(Sender, e)
or
you can directly call it by sending null values
Gird1_RowDataBound(null, null)
这篇关于当我点击按钮C#时调用Gridview Rowdatabound的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文