ArrayList dataArray = new ArrayList(); for (int rowIndex = gv1.Rows.Count - 2; rowIndex > 0; rowIndex--) { //for (int rowIndex = 1; rowIndex < gv1.Rows.Count; rowIndex++) //{ //int rowIndex = gv1.Rows.Count; //GridViewRow row1 = gv1.Rows[rowIndex]; GridViewRow previousRow = gv1.Rows[rowIndex + 1 ]; int c1 = 0; int cv1 = 0; foreach (GridViewRow row1 in gv1.Rows) { //for (int i = 0; i < row1.Cells.Count; i++) //{ if (row1.Cells[1].Text != previousRow.Cells[1].Text) { //row2 = row1; cv1 = System.Convert.ToInt32(row1.Cells[4].Text); c1 += cv1; row1.Cells[5].Text = c1.ToString(); dataArray.Add(c1); } //} } //break; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)