Monday, April 20, 2015

Using DataBinder.Eval in the RowDataBound Event asp net gridview

decimal totalAmount = 0;
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
 totalAmount += Decimal.Parse(DataBinder.Eval(e.Row.DataItem, "Amount").ToString());
}
}