asp.net Gridview里添加汇总行
if (e.Row.RowType == DataControlRowType.DataRow)
{
totalcash += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "cash"));
totalunbalanced += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "unbalanced"));
totalsettled += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "settled"));
}
else if(e.Row .RowType ==DataControlRowType .Footer )
{
e.Row.Cells[0].Text = "合计";
e.Row.Cells[1].Text = totalcash.ToString("0.00");
e.Row.Cells[2].Text = totalunbalanced.ToString("0.00");
e.Row.Cells[3].Text = totalsettled.ToString("0.00");
e.Row.Font.Bold = true;
}
相关文章
基于Asp.Net MVC4 Bundle捆绑压缩技术的介绍
本篇文章,小编将为大家介绍,Asp.Net MVC4 Bundle捆绑压缩技术,有需要的朋友可以参考一下2013-04-04
ASP.NET The system cannot find the file specified解决办法
这篇文章主要介绍了ASP.NET The system cannot find the file specified解决办法的相关资料,需要的朋友可以参考下2016-11-11
ASP.NET小结之MVC, MVP, MVVM比较以及区别(二)
上一篇得到大家的关注,非常感谢。由于自己对于这些模式的理解也是有限,对于MVC,MVP,MVVM这些模式的比较,是结合自己的理解,一些地方不一定准确,需要的朋友可以参考下2014-05-05


最新评论