控件中国网现已改版,您看到的是老版本网站的镜像,系统正在为您跳转到新网站首页,请稍候.......
中国最专业的商业控件资讯网产品咨询电话:023-67870900 023-67871946
产品咨询EMAIL:SALES@COMPONENTCN.COM

GRIDVIEW FOOTER 多行 合并

作者:佚名 出处:互联网 2011年05月12日 阅读:

GRIDVIEW 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 = "";
            
          
            }

 

热推产品

  • ActiveReport... 强大的.NET报表设计、浏览、打印、转换控件,可以同时用于WindowsForms谀坔攀戀Forms平台下......
  • AnyChart AnyChart使你可以创建出绚丽的交互式的Flash和HTML5的图表和仪表控件。可以用于仪表盘的创......
首页 | 新闻中心 | 产品中心 | 技术文档 | 友情连接 | 关于磐岩 | 技术支持中心 | 联系我们 | 帮助中心 Copyright-2006 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 电话:023 - 67870900 传真:023 - 67870270 产品咨询:sales@componentcn.com 渝ICP备12000264号 法律顾问:元炳律师事务所 重庆市江北区塔坪36号维丰创意绿苑A座28-5 邮编:400020
在线客服
在线客服系统
在线客服
在线客服系统