亲宝软件园·资讯

展开

Gridview 汇总 asp.net Gridview里添加汇总行

人气:0
想了解asp.net Gridview里添加汇总行的相关内容吗,在本文为您仔细讲解Gridview 汇总的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点: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;
}

加载全部内容

相关教程
猜你喜欢
用户评论