帮忙解释解释合并单元格的段代码,
#region 合并单元格protected void Unite(GridView gv)
{
int i;
string LastType1;
int LastCell;
if (gv.Rows.Count > 0)
{
for (int j = 0; j < 6; j++)
{
if (j != 1 && j != 2 && j != 3)
{
LastType1 = gv.Rows[0].Cells[j].Text;
gv.Rows[0].Cells[j].RowSpan = 1;
LastCell = 0;
for (i = 1; i < gv.Rows.Count; i++)
{
if (gv.Rows[i].Cells[j].Text == LastType1)
{
gv.Rows[i].Cells[j].Visible = false;
gv.Rows[LastCell].Cells[j].RowSpan++;
}
else
{
LastType1 = gv.Rows[i].Cells[j].Text;
LastCell = i;
gv.Rows[i].Cells[j].RowSpan = 1;
}
}
}
}
}
}
#endregion
补充:.NET技术 , ASP.NET