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.
Loading
Pravin GhadgePosted Dec 21, 2011, 4:48 AM
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();
}
Vijay YadavPosted Dec 21, 2011, 5:51 AM
aleksandar rubaPosted Dec 21, 2011, 5:37 AM
this code works for me ,only the cell[x].value dont work,i put .text and works great!!!