protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int i = 1; i < GridView1.Rows.Count; i++)
{
if (GridView1.Rows[i].Cells[4].Text == GridView1.Rows[i - 1].Cells[4].Text)//
{
if (GridView1.Rows[i - 1].Cells[4].RowSpan != 0)
{
GridView1.Rows[i - 1].Cells[4].RowSpan++;
GridView1.Rows[i].Cells[4].Visible = false;
}
else
{
GridView1.Rows[i - 1].Cells[4].RowSpan = 2;
GridView1.Rows[i].Cells[4].Visible = false;
}
}
}
}
- 本文标题: GridView合并单元格 ASP.NET
- 文章分类:【.NET/Web】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.