title: ASP.Net GridView RowUpdate not firing and RowUpdating doesn't have NewValues
body: <p>I have the following GridView:</p>
  
  
  
  <pre class="lang-cs prettyprint-override"><code>&lt;asp:GridView ID="gridCar" runat="server" RowStyle-ForeColor="Black" AllowSorting="true" OnSorting="gridCar_Sorting" AutoGenerateEditButton="true" OnRowEditing="gridCar_RowEditing" OnRowCancelingEdit="gridCar_RowCancelingEdit" OnRowUpdating="gridCar_RowUpdating" OnRowUpdated="gridCar_RowUpdated"&gt;&lt;/asp:GridView&gt;
  </code></pre>
  
  <p>I want to update the row selected by the edit button. The problem is, if I try to do it in <code>gridCar_RowUpdating</code>, <code>e.NewValues</code> doesn't contain the edited values but the old ones instead.</p>
  
  <p>I searched around and found out that I might have to use <code>onRowUpdated</code> event instead, but then I face another problem; this event isn't fired at all. I tried to set <code>e.Cancel = false</code> in <code>gridCar_RowUpdating</code> but that won't fix the issue.</p>
  
  <p>The GridView is binded to a DataTable.</p>
  
  <p>EDIT: Here's my code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  using System.Data;
  
  public partial class _Default : Page
  {
      DataTable carsTable = new DataTable("cars");
  
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              carsTable.Columns.Add("CarID");
              carsTable.Columns.Add("CarRegNum");
              carsTable.Columns.Add("CarModel");
              carsTable.Columns.Add("CarType");
              carsTable.Columns.Add("CarOwner");
  
              carsTable.Rows.Add(1, "AAA-111", "Toyota", "Hatchback", "Matti");
              carsTable.Rows.Add(2, "BBB-222", "Mercedes-Benz", "Van", "Keijo");
              carsTable.Rows.Add(3, "CCC-333", "Renault", "Regular", "Matilda");
  
              carsTable.AcceptChanges();
  
              gridCar.DataSource = carsTable;
              gridCar.DataBind();
          }
      }
  
      protected string dataViewSortDirection(SortDirection direction)
      {
          switch (direction)
          {
              case SortDirection.Ascending:
                  return "ASC";
              case SortDirection.Descending:
                  return "DESC";
              default:
                  throw new ArgumentOutOfRangeException();
          }
      }
  
      protected void gridCar_Sorting(object sender, GridViewSortEventArgs e)
      {
          gridCar.Sort(e.SortExpression, e.SortDirection);
  
          // update GridView
          gridCar.DataBind();
      }
  
      protected void gridCar_RowEditing(object sender, GridViewEditEventArgs e)
      {
          gridCar.EditIndex = e.NewEditIndex;
          gridCar.DataBind();
      }
  
      protected void gridCar_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
      {
          gridCar.EditIndex = -1;
          gridCar.DataBind();
      }
  
      protected void gridCar_RowUpdating(object sender, GridViewUpdateEventArgs e)
      {
          labelDebug.Text += "b";
          //gridCar.EditIndex = -1;
          //gridCar.DataBind();
      }
  
      protected void gridCar_RowUpdated(object sender, GridViewUpdatedEventArgs e)
      {
          labelDebug.Text += "a";
          gridCar.EditIndex = -1;
          gridCar.DataBind();
      }
  }
  </code></pre>