title: gridview does not refresh after delete in updatepanel
body: <p>I have a gridview inside updatepanel which after deleting a record does not refresh.</p>
  
  <pre><code>&lt;ajax:UpdatePanel ID="SearchResultAjax" runat="server" UpdateMode="Always"&gt;
  &lt;ContentTemplate&gt;
  &lt;asp:GridView runat="server" ID="mwOffersGrid" AutoGenerateColumns="False" Width="100%" DataKeyNames="OfferId" OnRowCommand="mwOffersGrid_RowCommand"   
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="Offer #"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:HyperLink runat="server" ID="offerIdLink" NavigateUrl='&lt;%# String.Format("/Admin/Marketing/MWOffers/EditOffer.aspx?OfferId={0}",Eval("OfferId")) %&gt;'
              Text='&lt;%# Eval("OfferId") %&gt;' /&gt;
          &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemStyle HorizontalAlign="Right" Wrap="false" /&gt;
              &lt;ItemTemplate&gt;
              &lt;asp:ImageButton ID="EditButton" runat="server" CommandName="EditOffer" CommandArgument='&lt;%# Eval("OfferId") %&gt;' ToolTip="Edit" SkinID="EditIcon" /&gt;
              &lt;asp:ImageButton ID="DeleteButton" runat="server" CommandName="DeleteOffer" CommandArgument='&lt;%# Eval("OfferId") %&gt;'  ToolTip="Delete"
              SkinID="DeleteIcon" OnClientClick='&lt;%# Eval("OfferId", "return confirm(\"Are you sure you want to delete Offer # {0}?\")") %&gt;' /&gt;
              &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;/ContentTemplate&gt;
  &lt;/ajax:UpdatePanel&gt;
  </code></pre>
  
  <h1>Code Behind</h1>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
    {
      MWOffersCollection OffersCollection = MWOffersDataSource.LoadForCriteria(SqlCriteria, "OfferPageType ASC, OrderBy ASC");
      if (!Page.IsPostBack)
      {
        if (OffersCollection != null)
        {
              BindGrid();
        }
      }
    }
  
    public void BindGrid()
    {
      mwOffersGrid.DataSource = OffersCollection;
      mwOffersGrid.DataBind();
    }
  
  protected void mwOffersGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
      switch (e.CommandName)
      {
  
      case "EditOffer":
          var offerId = AlwaysConvert.ToInt(e.CommandArgument);
          Response.Redirect(string.Format("~/Admin/Marketing/MWOffers/EditOffer.aspx?OfferId={0}", offerId));
          break;
  
      case "DeleteOffer":
            var id = AlwaysConvert.ToInt(e.CommandArgument);
                      OffersCollection.Cast&lt;MWOffers&gt;().Single(o =&gt; o.OfferId == id).IsValid = false;
                      OffersCollection.Save();
                      BindGrid();
                      break;
          break;
      }
    }
  </code></pre>