首页 > Web开发 > 详细

asp.net table/gridview 合并列

时间:2016-01-25 10:00:15      阅读:122      评论:0      收藏:0      [点我收藏+]
        public void MergeCell(TableRow trow)
        {
            TableCell currentCell = trow.Cells[0];
            TableCell prevCell = null;
            for (var i = 0; i < trow.Cells.Count; i++)
            {
                currentCell = trow.Cells[i];
                if (prevCell != null && currentCell.Text == prevCell.Text)
                {
                    prevCell.ColumnSpan = (prevCell.ColumnSpan == 0 ? 1 : prevCell.ColumnSpan) + 1;
                    currentCell.Visible = false;
                }
                else
                {
                    prevCell = currentCell;
                }
            }
        }

 

asp.net table/gridview 合并列

原文:http://www.cnblogs.com/thirties/p/5156564.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!