i am trying to display gridview and total in footer, but have some null value in column.
so how to avoid this
Input string was not in a correct format.
Label lblrecamt = (Label)e.Row.FindControl("Rec_Amt");
lblTotalAMt += Convert.ToDecimal(lblrecamt.Text);
Decimal lblTotalAMt = 0;
Decimal TotalValueSA = 0;
protected void gvsummaryrpt_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblSA = (Label)e.Row.FindControl("Total_Amt");
TotalValueSA += Convert.ToDecimal(lblSA.Text);
Label lblrecamt = (Label)e.Row.FindControl("Rec_Amt");
lblTotalAMt += Convert.ToDecimal(lblrecamt.Text);
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
Label lbSA = (Label)e.Row.FindControl("lblTotalSA");
lbSA.Text = TotalValueSA.ToString();
Label lbrec = (Label)e.Row.FindControl("lblTotalAMt");
lbrec.Text = lblTotalAMt.ToString();
}
}