title: What rebinding a gridview has to do with edit mode?
body: <p>Gridview remains in EDIT mode when i don't rebind it, why ? but when i rebind gridview that it exits out of eidt mode successfully, why ?</p>
  
  <p>code: </p>
  
  <pre><code>protected void gvTest_EditCancel(Object sender, GridViewCancelEditEventArgs e) 
  {
      gvTest.EditIndex = -1;
    //  connectToDb();
      Response.Write("&lt;br/&gt;"+ "Editing cancelled");
  }`
  
  public void connectToDb() 
  {
      SqlConnection sqlcon = new SqlConnection(constrng);
      String com1 = "select * from login";
      SqlCommand sqlcom = new SqlCommand(com1, sqlcon);
      SqlDataAdapter sqlda = new SqlDataAdapter(sqlcom);
      DataSet ds = new DataSet();
  
      try
      {
          sqlcon.Open();
          sqlda.Fill(ds);
          gvTest.DataSource = ds;
          gvTest.DataBind();
      }
      catch (Exception exc)
      {
          Response.Write(exc.ToString());
      }
      finally
      {
          sqlcon.Close();
      }
  }
  </code></pre>
  
  <p>but when call ConnectToDb() to rebind then it successfully exists out of edit mode,
  what a rebinding has to do with EDITING or exiting of it ?</p>