Hey hello,
I have synario where i have to display addition of gridview column value. But it inclueds bot +ve and -ve Value.
I need to add only +ve Value.
Please Help.
I had written code as bellow
grdPayHistory.DataBind();
float tdstotal = ds.Tables[0].AsEnumerable().Sum(row => row.Field<float>("Tds_Amount"));
float paytotal = ds.Tables[0].AsEnumerable().Sum(row => row.Field<float>("Payment_Amount"));
grdPayHistory.FooterRow.Cells[2].Text = "Total";
grdPayHistory.FooterRow.Cells[3].HorizontalAlign = HorizontalAlign.Right;
grdPayHistory.FooterRow.Cells[3].Text = tdstotal.ToString();
grdPayHistory.FooterRow.Cells[4].Text = paytotal.ToString();
grdPayHistory.FooterRow.Cells[5].Text = (tdstotal+ paytotal).ToString();