asp.net Gridview里添加汇总行
2008-11-13 00:00
555 查看
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;
}
{
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中用javascript为GridView添加汇总行
- asp.net Gridview里添加汇总行
- ASP.NET中GridView动态添加下拉框
- 关于asp.net中gridview的问题,关于footer,16aspx上下的英语交流网程序,管理员的添加和修改有问题
- ASP.NET中GridView设计汇总
- asp.net gridview添加删除确认对话框
- ASP.NET中为GridView添加确认提示框
- ASP.NET中GridView设计汇总
- 在ASP.NET中为GridView添加删除提示框
- Scott Mitchell 的ASP.NET 2.0数据教程之52:为GridView控件添加Checkboxes列
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2005 C# GridView添加序号列
- asp.net 程序动态添加gridview
- ASP.NET 2.0中动态添加GridView
- ASP.NET的gridview的页脚添加合计字段
- ASP.NET中为GridView添加删除提示框
- ASP.NET 2.0 中动态添加 GridView 模板列
- Asp.Net 中的GridView 添加行单击事件
- Asp.Net GridView汇总
- 在ASP.NET 2.0中操作数据之五十:为GridView控件添加Checkbox