title: The GridView fired event RowEditing which wasn't handled
body: <pre><code>using System;
  using System.Collections.Generic;
  using System.Configuration;
  using System.Data;
  using System.Data.SqlClient;
  using System.IO;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace AppManagementConsole
  {
      public partial class _Default : Page
      {
          string BuildUploadPath = ConfigurationManager.AppSettings["DirectoryPath"] + "Files/";
          string ReleaseNotesUpPath = ConfigurationManager.AppSettings["DirectoryPath"] + "ReleaseNotes/";
  
      protected void Page_Load(object sender, EventArgs e)
      {
          cpBuildDate.SelectedDate = DateTime.Now;
          getBuildData();
      }
  
      public void getBuildData()
      {
          //Select Build List
          SqlCommand selectCommand = new SqlCommand("Select * from tblBuildList");
  
          try
          {
              //Connect to DB
              using (SqlConnection conRDB = new SqlConnection(ConfigurationManager.ConnectionStrings["conRDB"].ConnectionString))
              {
                  SqlDataAdapter selectAdapater = new SqlDataAdapter(selectCommand.CommandText, conRDB);
  
                  DataSet dsBuilds = new DataSet();
                  selectAdapater.Fill(dsBuilds);
  
                  //Populate Webpage GV
                  gvDataBind(dsBuilds);
              }
          }
  
          catch (Exception ex)
          {
          }
      }
  
  
      public void gvDataBind(DataSet dsBuilds)
      {
          gvBuildList.Dispose();
          gvBuildList.DataSource = dsBuilds;
          gvBuildList.DataBind();
      }
  
      protected void gvBuildList_RowEditing(object sender, GridViewEditEventArgs e)
      {
          gvBuildList.PageIndex = e.NewEditIndex;
          //Bind data to the GridView control.
          getBuildData();
      }
  
      protected void btnSubmit_Click(object sender, EventArgs e)
      {
          //Upload Files
          UploadFiles();
  
          //Update SQL Table
          AddBuildInfo(txtProduct.Text, txtPlatform.Text, cpBuildDate.SelectedDate, txtPublisher.Text, txtVersion.Text, BuildUploadPath,FileUpBuild.FileName, ReleaseNotesUpPath, FileUpRelease.FileName, txtComments.Text);
      }
  
      private void UploadFiles()
      {
          #region Build
          string tempfileDir = @"C:\Publish\TempFileStorage\";
          if (FileUpBuild.HasFile)
          {
              try
              {
                  if (!Directory.Exists(tempfileDir))
                  {
                      Directory.CreateDirectory(tempfileDir);
                  }
                  FileUpBuild.SaveAs(@"C:\Publish\TempFileStorage\" + FileUpBuild.FileName);
                  FTP.FtpUpload(BuildUploadPath, FileUpBuild.FileName, tempfileDir + FileUpBuild.FileName);
                  //FileUpBuild.SaveAs();
                  //FileUpBuild.FileContent();
              }
              catch (Exception ex)
              {
              }
              finally
              {
                  File.Delete(@"C:\Publish\TempFileStorage\" + FileUpBuild.FileName);
              }
          }
          #endregion
  
          #region ReleaseNotes
          if (FileUpRelease.HasFile)
          {
              try
              {
                  if (!Directory.Exists(tempfileDir))
                  {
                      Directory.CreateDirectory(tempfileDir);
                  }
                  FileUpRelease.SaveAs(@"C:\Publish\TempFileStorage\" + FileUpRelease.FileName);
                  FTP.FtpUpload( ReleaseNotesUpPath, FileUpRelease.FileName, tempfileDir + FileUpRelease.FileName);
                  //FileUpBuild.SaveAs();
                  //FileUpBuild.FileContent();
              }
              catch (Exception ex)
              {
              }
              finally
              {
                  File.Delete(@"C:\Publish\TempFileStorage\" + FileUpRelease.FileName);
              }
          }
          #endregion
  
      }
  
      private void AddBuildInfo(string product, string platform, DateTime builddate, string publisher, string version, string location, string filename, string releaseloc, string releasefile, string comment)
      {
          try
          {
              using (SqlConnection conRDB = new SqlConnection(ConfigurationManager.ConnectionStrings["conRDB"].ConnectionString))
              {
                  SqlCommand insertCommand = new SqlCommand("Insert into tblBuildList " +
                                                  "Values('" + product + "'," +
                                                          "'" + platform + "'," +
                                                          "'" + builddate + "'," +
                                                          "'" + publisher + "'," +
                                                          "'" + version + "'," +
                                                          "'" + location + "'," +
                                                          "'" + filename + "'," +
                                                          "'" + releaseloc + "'," +
                                                          "'" + releasefile + "'," +
                                                          "'" + comment + "')", conRDB);
                  conRDB.Open();
                  insertCommand.ExecuteNonQuery();
  
                  getBuildData();
                  conRDB.Close();
              }
          }
  
          catch (Exception ex)
          {
          }
      }
  
      protected void btnUpBuild_Click(object sender, EventArgs e)
      {
          string tempfileDir = @"C:\Publish\TempFileStorage\";
          if (FileUpBuild.HasFile)
          {
              try
              {
                  if (!Directory.Exists(tempfileDir))
                  {
                      Directory.CreateDirectory(tempfileDir);
                  }
                  FileUpBuild.SaveAs(@"C:\Publish\TempFileStorage\" + FileUpBuild.FileName);
                  FTP.FtpUpload(BuildUploadPath, FileUpBuild.FileName, tempfileDir + FileUpBuild.FileName);
                  //FileUpBuild.SaveAs();
                  //FileUpBuild.FileContent();
              }
              catch (Exception ex)
              {
              }
              finally
              {
                  File.Delete(@"C:\Publish\TempFileStorage\" + FileUpBuild.FileName);
              }
          }
      }
  
      protected void btnUpRelease_Click(object sender, EventArgs e)
      {
          string tempfileDir = @"C:\Publish\TempFileStorage\";
          if (FileUpRelease.HasFile)
          {
              try
              {
                  if (!Directory.Exists(tempfileDir))
                  {
                      Directory.CreateDirectory(tempfileDir);
                  }
                  FileUpRelease.SaveAs(@"C:\Publish\TempFileStorage\" + FileUpRelease.FileName);
                  FTP.FtpUpload( ReleaseNotesUpPath, FileUpRelease.FileName, tempfileDir + FileUpRelease.FileName);
                  //FileUpBuild.SaveAs();
                  //FileUpBuild.FileContent();
              }
              catch (Exception ex)
              {
              }
              finally
              {
                  File.Delete(@"C:\Publish\TempFileStorage\" + FileUpRelease.FileName);
              }
          }
      }
  
  }
  </code></pre>
  
  <p>Above is my code behind</p>
  
  <p>Below is my .aspx page</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;div id="Addnewbuild"&gt;
      &lt;h3&gt;Add a New Build&lt;/h3&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader1" runat="server"&gt;Product&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader2" runat="server"&gt;Platform&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader3" runat="server"&gt;Build Date&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader31" runat="server"&gt;Publisher&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader4" runat="server"&gt;Version #&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader5" runat="server"&gt;Build&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader6" runat="server"&gt;Release Notes&lt;/asp:Label&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;asp:Label ID="lblHeader7" runat="server"&gt;Comments&lt;/asp:Label&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtProduct" runat="server" Width="150px"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtPlatform" runat="server" Width="75px"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;ew:CalendarPopup ID="cpBuildDate" ControlDisplay="TextBoxButton" Text="Change Date"
                      runat="server" SelectedDate="" VisibleDate="" Visible="True" Enabled="True" Width="100px"&gt;
                  &lt;/ew:CalendarPopup&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtPublisher" runat="server" Width="75px"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtVersion" runat="server" Width="75px"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:FileUpload ID="FileUpBuild" runat="server" /&gt;
                  &lt;!--&lt;asp:Button ID="btnUpBuild" runat="server" Text="Upload Build" OnClick="btnUpBuild_Click" /&gt;--&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:FileUpload ID="FileUpRelease" runat="server" /&gt;
                  &lt;!--&lt;asp:Button ID="btnUpRelease" runat="server" Text="Upload Release Notes" OnClick="btnUpRelease_Click" /&gt;--&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtComments" runat="server" Width="100px" TextMode="MultiLine"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  
      &lt;asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClick="btnSubmit_Click" /&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  
  &lt;div id="buildlist"&gt;
      &lt;h3&gt;Build List&lt;/h3&gt;
              &lt;asp:GridView ID="gvBuildList" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnRowEditing="gvBuildList_RowEditing" AutoGenerateEditButton="True"&gt;
                  &lt;Columns&gt;
                      &lt;asp:TemplateField HeaderText="Product"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblProduct" runat="server" Text='&lt;%#Eval("ProductName")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVProduct" runat="server" Text='&lt;%#Eval("ProductName")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Platform"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblplatform" runat="server" Text='&lt;%#Eval("Platform")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVPlatform" runat="server" Text='&lt;%#Eval("Platform")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Build Date"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblbldDate" runat="server" Text='&lt;%#Eval("BuildDate")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVbldDate" runat="server" Text='&lt;%#Eval("BuildDate")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Publisher"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblPublisher" runat="server" Text='&lt;%#Eval("Publisher")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVPublisher" runat="server" Text='&lt;%#Eval("Publisher")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Version #"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblVersion" runat="server" Text='&lt;%#Eval("VersionNumber")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVVersion" runat="server" Text='&lt;%#Eval("VersionNumber")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Build"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblbldLocation" runat="server" Text='&lt;%#Eval("FileName")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVbldLocation" runat="server" Text='&lt;%#Eval("FileName")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Release Notes"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblRelease" runat="server" Text='&lt;%#Eval("ReleaseFileName")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVRelease" runat="server" Text='&lt;%#Eval("ReleaseFileName")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Comments"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblComments" runat="server" Text='&lt;%#Eval("Comments")%&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGVComments" runat="server" Text='&lt;%#Eval("Comments")%&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:CommandField ShowEditButton="True" ButtonType="Button" /&gt;
                      &lt;asp:CommandField ShowDeleteButton="True" ButtonType="Button" /&gt;
                      &lt;asp:TemplateField HeaderText="Actions"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:ImageButton ID="btnDwnld" runat="server" ImageURL="Images/hard-drive-download.png" Width="20" Height="20" /&gt;
                              &lt;asp:ImageButton ID="btnEmail" runat="server" ImageURL="Images/email-icon.png" Width="20" Height="20" /&gt;
                          &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                  &lt;/Columns&gt;
              &lt;/asp:GridView&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Above is my GridView code, I have about 8 other columns too but I removed them.</p>
  
  <p>Even though I have the row Editing method to catch any edits, my page keeps on throwing the error:</p>
  
  <blockquote>
    <p>The GridView 'gvBuildList' fired event RowEditing which wasn't handled.</p>
  </blockquote>
  
  <p>Description: </p>
  
  <blockquote>
    <p>An unhandled exception occurred during the execution of the current
    web request. Please review the stack trace for more information about
    the error and where it originated in the code.</p>
  </blockquote>
  
  <p>Exception Details:</p>
  
  <blockquote>
    <p>System.Web.HttpException: The GridView 'gvBuildList' fired event
    RowEditing which wasn't handled.</p>
  </blockquote>
  
  <p>Source Error: </p>
  
  <blockquote>
    <p>An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.</p>
  </blockquote>
  
  <p>Stack Trace: </p>
  
  <blockquote>
    <p>HttpException (0x80004005): The GridView 'gvBuildList' fired event
    RowEditing which wasn't handled.<br>
    System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs
    e) +1588857    System.Web.UI.WebControls.GridView.HandleEdit(Int32
    rowIndex) +43<br>
    System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean
    causesValidation, String validationGroup) +611<br>
    System.Web.UI.WebControls.GridView.RaisePostBackEvent(String
    eventArgument) +205<br>
    System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +13<br>
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +13<br>
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    +9643314    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +1724</p>
  </blockquote>
  
  <p>Any ideas?</p>