日期:2014-05-18 浏览次数:20424 次
//从grd的第rowIndex行colIndex列单元格以下count行合并 public static void 合并行(GridView grd, int rowIndex, int colIndex, int count) { grd.Rows[rowIndex].Cells[colIndex].RowSpan = count; for (var i = rowIndex + 1; i < rowIndex + count; i++) grd.Rows[i].Cells[colIndex].Visible = false; } //从grd的第rowIndex行colIndex列单元格向右count列合并 public static void 合并列(GridView grd, int rowIndex, int colIndex, int count) { grd.Rows[rowIndex].Cells[colIndex].ColumnSpan = count; for (var i = 1; i < count; i++) grd.Rows[rowIndex].Cells[colIndex + i].Visible = false; }