{
if (e.Row.RowType == DataControlRowType.DataRow)
{
double rowpremiumTotal = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Premium"));
grdPremiumTotal = grdPremiumTotal + rowpremiumTotal;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblPremiumTotal = (Label)e.Row.FindControl("lblPremiumTotal");
lblPremiumTotal.Text = grdPremiumTotal.ToString("c");
}
}
Design :
Calculating columns in GridView for WinForms
ReplyDelete