grid view column sum but not finding the total sum in footer
not finding sum last line please help me?
if (e.Row.RowType == DataControlRowType.DataRow)
{
decimal netpremium = Convert.ToDecimal(e.Row.Cells[2].Text);
decimal vat = Convert.ToDecimal(e.Row.Cells[3].Text);
decimal registry = Convert.ToDecimal(e.Row.Cells[4].Text);
Label lblTOTAL = (Label)e.Row.Cells[6].FindControl("lblTOTAL");
decimal sum = netpremium + vat + registry;
lblTOTAL.Text += sum.ToString();
}
else if(e.Row.RowType==DataControlRowType.Footer)
{
//e.Row.Cells[6].Text = string.Format("{0:c}", sum);
//GridView1.FooterRow.Cells[4].Text = dt.Compute("Sum(BANK_RECEIVED)", "").ToString();
//Label lbl = (Label)e.Row.FindControl("lblTotal");
//lbl.Text = sum.ToString();
//lbl.Text = "Total Value is : " + sum.ToString();
(e.Row.FindControl("Total") as Label).Text = sum.ToString();
}