public decimal Heji(int col)
{
//decimal alltotal = 0;
decimal alltotal = 0;
foreach (GridViewRow gvr in GVmain.Rows)
{
//if (null != gvr.Cells[col].Text)
if (gvr.Cells[col].Text != null && gvr.Cells[col].Text != "")
{
alltotal += Convert.ToDecimal(gvr.Cells[col].Text);
}
}
return alltotal;
}
protected void GridView_RowDtataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[7].Text = Heji(7).ToString();
}
}
{
//decimal alltotal = 0;
decimal alltotal = 0;
foreach (GridViewRow gvr in GVmain.Rows)
{
//if (null != gvr.Cells[col].Text)
if (gvr.Cells[col].Text != null && gvr.Cells[col].Text != "")
{
alltotal += Convert.ToDecimal(gvr.Cells[col].Text);
}
}
return alltotal;
}
protected void GridView_RowDtataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[7].Text = Heji(7).ToString();
}
}