title: edit in datarow bound
body: <p>i have gridview with many col some of col will sum and display in total col using rowdatabound and it works only in view, but the problem when i try to edit using edit statement that gridview have this error appear (Troubleshooting exceptions: system.nullreferenceexception)</p>
  
  <pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          string val1 = e.Row.Cells[13].Text; //Gets the value in Column 1
          string val2 = e.Row.Cells[14].Text; //Gets the value in Column 2
          string val3 = e.Row.Cells[15].Text; //Gets the value in Column 3
          string val4 = e.Row.Cells[16].Text; //Gets the value in Column 4
          Label lblTotal = (Label)e.Row.Cells[12].FindControl("Label1"); //
          float _val1, _val2, _val3, _val4;
  
          float.TryParse(val1, out _val1);
          float.TryParse(val2, out _val2);
          float.TryParse(val3, out _val3);
          float.TryParse(val4, out _val4);
  
          float sum = _val1 + _val2 + _val3 + _val4;
          lblTotal.Text += sum.ToString();
      }
  }
  </code></pre>