Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ASP
Posted by: Mario Lopes
Added: Oct 30, 2018 12:54 PM
Views: 35
  1. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  2.     {
  3.         if (e.Row.RowType == DataControlRowType.DataRow)
  4.         {
  5.            
  6.             if (e.Row.Cells[0].Text == "3")
  7.             {
  8.                 e.Row.Cells[3].Text = System.Convert.ToString(-System.Convert.ToDouble(e.Row.Cells[3].Text));
  9.                 e.Row.ForeColor = System.Drawing.Color.OrangeRed;
  10.             }
  11.             total = total + Convert.ToDouble(e.Row.Cells[3].Text);
  12.             Label extrato = (Label)e.Row.Cells[4].FindControl("Label1");
  13.             extrato.Text = total.ToString();
  14.         }
  15.         if (e.Row.RowType == DataControlRowType.Footer)
  16.         {
  17.             e.Row.Cells[0].Text = total.ToString();
  18.         }
  19.     }