- for (int k = 0; k < this.GridView1.Rows.Count - 1; k++)
- {
- if (this.GridView1.Rows[k].Cells[1].Text.Trim() == "Comment:")
- {
- this.GridView1.Rows[k].Cells[0].Attributes["colspan"] = "11";
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells.RemoveAt(1);
- this.GridView1.Rows[k].Cells[0].Text = "Comment:"+this.GridView1.Rows[k - 1].Cells[11].Text;
- }
GridView合并列(行之间的单元格)
最新推荐文章于 2020-11-24 16:20:08 发布