gridview多行footer,并且合并footer单元格

(在gridview的RowCreated的事件里面写下如下代码
if (e.Row.RowType == DataControlRowType.Footer)
{
TableCellCollection tcc = e.Row.Cells;
//this.GridViewProjectGroupQuatityView.FooterRow.Cells.Add(new TableCell());
tcc.Clear();
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[0].Attributes.Add("colspan","4");
e.Row.Cells[0].Text = "平均值";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[1].BackColor = TransColor("#F2F2F0");
e.Row.Cells[1].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[2].BackColor = TransColor("#F2F2F0");
e.Row.Cells[2].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[3].BackColor = TransColor("#F2F2F0");
e.Row.Cells[3].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[4].BackColor = TransColor("#F2F2F0");
e.Row.Cells[4].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[5].BackColor = TransColor("#F2F2F0");
e.Row.Cells[5].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[6].BackColor = TransColor("#F2F2F0");
e.Row.Cells[6].Text = "";//
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[7].BackColor = TransColor("#F2F2F0");
e.Row.Cells[7].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[8].BackColor = TransColor("#F2F2F0");
e.Row.Cells[8].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[9].BackColor = TransColor("#F2F2F0");
e.Row.Cells[9].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[10].BackColor = TransColor("#F2F2F0");
e.Row.Cells[10].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[11].BackColor = TransColor("#F2F2F0");
e.Row.Cells[11].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[12].BackColor = TransColor("#F2F2F0");
e.Row.Cells[12].Text = "</ th ></ tr >< tr >";//注意这里,要换行了哦!
 
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[13].Attributes.Add("colspan", "4");
e.Row.Cells[13].Text = "总值";
e.Row.Cells[13].HorizontalAlign = HorizontalAlign.Center;
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[14].BackColor = TransColor("#F2F2F0");
e.Row.Cells[14].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[15].BackColor = TransColor("#F2F2F0");
e.Row.Cells[15].Text = "";
 
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[16].BackColor = TransColor("#F2F2F0");
e.Row.Cells[16].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[17].BackColor = TransColor("#F2F2F0");
e.Row.Cells[17].Text = "";
 
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[18].BackColor = TransColor("#F2F2F0");
e.Row.Cells[18].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[19].BackColor = TransColor("#F2F2F0");
e.Row.Cells[19].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[20].BackColor = TransColor("#F2F2F0");
e.Row.Cells[20].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[21].BackColor = TransColor("#F2F2F0");
e.Row.Cells[21].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[22].BackColor = TransColor("#F2F2F0");
e.Row.Cells[22].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[23].BackColor = TransColor("#F2F2F0");
e.Row.Cells[23].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[24].BackColor = TransColor("#F2F2F0");
e.Row.Cells[24].Text = "";
 
e.Row.Cells.Add(new TableCell());
e.Row.Cells[25].BackColor = TransColor("#F2F2F0");
e.Row.Cells[25].Text = "";
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值