Good day!
i have a problem and if you can help i will be grateful!
i have a gridview control on my webpage.
i wont to sum all value from one column and multiply with sum of another column and display the resultat of multiplaying in label.
this must bi done in page load so without using any control(button...)?
thx.
Gridview problem!
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 20, 2011, 11:48 PM EST
call this function on Page_load event:
private void Sum()
{
double Column1=0;
double Column2=0;
double Mult=0;
for(int i=0;i
Column1=Column1+ Convert.ToDouble(dgv.Rows[i].Cells["Column1"].Value);
Column2=Column2+ Convert.ToDouble(dgv.Rows[i].Cells["Column2"].Value);
}
Mult=Column1*Column2;
lblamount.Text = Mult.ToString();
}
aleksandar ruba33 reputationPosted Dec 21, 2011, 12:37 AM EST
this code works for me ,only the cell[x].value dont work,i put .text and works great!!!
Vijay YadavRank #1,637 · 943 reputationPosted Dec 21, 2011, 12:51 AM EST