Adding Particular columns value in gridview

Debendra256
Posted by Debendra256 under ASP.NET category on | Points: 40 | Views : 622

double sum = 0;
for (int x = 0; x < GridView1.Rows.Count; x++)
{
sum += Convert.ToDouble(GridView1.Rows[x].Cells[3].Text);

}


Txt_amo.Text = sum.ToString();


Here cell[3] indicate the cell value which i am going to sum

Comments or Responses

Posted by: Rajnilari2015 on: 4/11/2016 Level:Platinum | Status: [Member] [Microsoft_MVP] [MVP] | Points: 10
Txt_amo.Text = sum.ToString();


should be outside the for loop

Login to post response