博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gridview多行footer,并且合并footer单元格
阅读量:4211 次
发布时间:2019-05-26

本文共 3269 字,大约阅读时间需要 10 分钟。

(在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 = "";
 
效果图的网址:

转载地址:http://oozmi.baihongyu.com/

你可能感兴趣的文章
记腾讯互娱网站布局(1)
查看>>
记腾讯互娱网站布局(2)
查看>>
记腾讯互娱网站布局(3)
查看>>
大小不固定的图片和多行文字的垂直水平居中
查看>>
display:table-cell的集中应用
查看>>
display:table-cell自适应布局下连续单词字符换行
查看>>
0115 springboot template方式操作mongodb
查看>>
0116 spring的webFlux
查看>>
解决 Asp.net 中,url传参乱码 方法之一:(UrlDecode)
查看>>
pdf的转换网址:
查看>>
c++设计模式之三~抽象工厂模式
查看>>
c++设计模式之单例模式
查看>>
c++设计模式之建造者模式
查看>>
c++设计模式之原型模式
查看>>
c++设计模式之适配器模式
查看>>
c++设计模式之桥接模式
查看>>
c++设计模式之装饰模式
查看>>
Mysql学习笔记(八)- 两个简单实用的优化方法
查看>>
mysql学习笔记(九)- 增删改查的优化
查看>>
Jenkins学习笔记(一)
查看>>