title: DetailsView not updating and changing only after 2 clicks, Cancel not showing editable values in readonly
body: <p>I created a detailsview which appears after a date is selected in a calender. This detailsview is filled via a select statement in code behind. Here is a list of my problems i encouter:</p>
  
  <ol>
  <li>I have to click twice on the edit button to get the detailsview in Edit mode.</li>
  <li>Once in edit mode i see the update and cancel button, but I also have to click twice on cancel to get back to the read only state.</li>
  <li>When I'm in Edit mode i have 3 rows which can be editted, when I press cancel twice in readOnly mode the values of these 3 rows aren't shown anymore, they're just empty fields although the data is still in the database.</li>
  <li>When I change something in Edit mode and press Update, my detailsview just dissapears.</li>
  </ol>
  
  <p>Code-behind:</p>
  
  <pre><code>protected void DetailView1_ModeChanging(Object sender, DetailsViewModeEventArgs e)
  {
      if (e.NewMode == DetailsViewMode.Edit)
      {
          DetailsView1.ChangeMode(e.NewMode);
      }
      if (e.CancelingEdit)
      {
          DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);   
      }
  }
  
  protected void DetailView1_ItemUpdating(Object sender, DetailsViewUpdateEventArgs e)
  {
      DetailsView1.DataBind();
  }
  
  protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
  {
      DetailsView1.DataBind();
  }
  </code></pre>
  
  <p>Markup:</p>
  
  <pre><code>&lt;asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
      OnModeChanging="DetailView1_ModeChanging" OnItemUpdating="DetailView1_ItemUpdating"
      OnItemUpdated="DetailsView1_ItemUpdated"
      AllowPaging="True" PageSize="5" HeaderText="Agenda"  CellPadding="10" 
      ForeColor="#333333" /&gt;
  </code></pre>