Int32 sum = 0; for (Int32 i = 0 ; i< this.GridView1.Rows.Count; i++) { sum += Int32.Parse(GridView1.Rows[i].Cells[4].Text); }
decimal a = 0; for (Int32 i = 0; i < this.GridView1.Rows.Count; i++) { a = a + Convert.ToDecimal(((Label)GridView1.Rows[i].FindControl("label3")).Text.ToString()); } lbl_total.Text = Convert.ToString(a);
Convert
ToString
Text
FindControl
TryParse
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)