title: GridView not refreshing after Delete event
body: <p>I am having a strange problem with asp.net <code>GridView</code>. I have <code>GridView</code> that is bound to a <code>LinqDataSource</code>. On <code>GridView</code>'s row deleting event, I am deleting the row from database, but the grid is not refreshed, (even after BINDING to the datasource).</p>
  
  <p>When I put a breakpoint, I could see the <code>OnRowDeleting</code> event is fired after the <code>LinqDS_Selecting</code> event. But its not fired again after the delete event! Could that be the reason? What am I doing wrong?</p>
  
  <p>Could some one please help. Many thanks in Advance.</p>
  
  <p>.aspx file:</p>
  
  <pre><code>&lt;asp:LinqDataSource
      ID="LinqDS"
      runat="server"
      OnSelecting="LinqDS_Selecting"&gt;
  &lt;/asp:LinqDataSource&gt;
  
  &lt;asp:GridView
      DataSourceID = "LinqDS"
      ID = "gv1"
      runat = "server"  
      DataKeyNames = "InstructionId"
      EnableViewState = "false"
      OnRowDataBound = "gv1_RowDataBound" 
      OnRowDeleting = "gv1_RowDeleting" 
      OnRowCommand = "gv1_RowCommand"
      PageSize = "30" &gt;
      &lt;Columns&gt;
          &lt;!-- My colums ---&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>.aspx.cs</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
  
  }
  
  protected void LinqDS_Selecting(object sender, LinqDataSourceSelectEventArgs e)
  {
      // my linq to sql query
      var query = from  .... .... ;
      e.Result = query;
  }
  
  protected void gv1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  {
      int instructionId = (int)gv1.DataKeys[e.RowIndex].Value;
      /// my delete logic
      CTX.SubmitChanges();
      gv1.DataBind();
  }
  </code></pre>