求一合併相同行問題,謝謝!
public void GridViewGroupRows1(GridView GridView2, int cellNum1, int cellNum2)
{
int i = 0,rowSpanNum1 = 1, rowSpanNum2 = 1;
while (i < GridView1.Rows.Count - 1)
{
GridViewRow gvr1 = GridView2.Rows[i];
for (++i; i < GridView2.Rows.Count; i++)
{
GridViewRow gvrNext1 = GridView2.Rows[i];
GridViewRow gvrNext2 = GridView2.Rows[i];
if (gvr1.Cells[cellNum1].Text == gvrNext1.Cells[cellNum1].Text)
{
gvrNext1.Cells[cellNum1].Visible = false;
rowSpanNum1++;
if (gvr1.Cells[cellNum2].Text == gvrNext1.Cells[cellNum2].Text)
{
gvrNext2.Cells[cellNum2].Visible = false;
rowSpanNum2++;
}
}
&n