protected void GridColumnsTotal()
{
for (var c = 0; c <= GvGRN.Rows.Count - 1; c++)
{
Label lblOpenig = (Label)GvGRN.Rows[c].FindControl("lblOpening");
TextBox txtQ = (TextBox)GvGRN.Rows[c].FindControl("Txtreceive");
Label lblQ = (Label)GvGRN.Rows[c].FindControl("lblReceive");
Label Clois = (Label)GvGRN.Rows[c].FindControl("lblClosing");
if (lblOpenig != null)
{
total += Convert.ToDouble(lblOpenig.Text);
}
if (txtQ != null)
{
pay += Convert.ToDouble(txtQ.Text);
}
if (lblQ != null)
{
QR += Convert.ToDouble(lblQ.Text);
}
if (Clois != null)
{
Tot += Convert.ToDouble(Clois.Text);
}
GvGRN.FooterRow.Cells[6].Text = total.ToString();
GvGRN.FooterRow.Cells[7].Text = (pay + QR).ToString();
GvGRN.FooterRow.Cells[8].Text = Tot.ToString();
}
}