今天用到GridView合并单元格,在网上找了些资料,为方便以后资料查找,特记录如下:
- private void MergeCells()
- {
- if (gvStock.Rows.Count < 1 || gvStock.Rows[0].Cells.Count < 1)
- {
- return;
- }
- for (int i = 0; i < 2; i++)
- {
- TableCell OldCell = gvStock.Rows[0].Cells[i];
- for (int j = 1; j < gvStock.Rows.Count; j++)
- {