title: New Record Does Not Show In ASP.net Datagrid Inside Updatepanel
body: <p>I have an asp.net webpage that contain a gridview with edit, select and delete enabled, and a detailview for inserting new record. Each control is placed inside a asp.net ajax extension control-updatepanel. And the two controls are bonded to the same datasource which is LinqDataSource. </p>
  
  <p>After new record was inserted nothing display in the gridview until user refresh the page.
  Did I miss something? Can anyone help?</p>
  
  <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt;
  &lt;fieldset&gt;
  
  &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt;       
      &lt;ContentTemplate&gt;
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
          DataSourceID="TermLinqDataSource" AllowPaging="True" AllowSorting="True" 
          DataKeyNames="TermID"&gt;
          &lt;Columns&gt;
              &lt;asp:CommandField 
                  ShowSelectButton="True" /&gt;
              &lt;asp:BoundField DataField="RowIndex" HeaderText="RowIndex" 
                  InsertVisible="False" SortExpression="RowIndex" Visible="False" /&gt;
              &lt;asp:BoundField DataField="TermID" HeaderText="Term" ReadOnly="True" 
                  SortExpression="TermID" /&gt;
              &lt;asp:BoundField DataField="StartDate" HeaderText="Start Date" 
                  SortExpression="StartDate" DataFormatString="{0:d}" /&gt;
              &lt;asp:BoundField DataField="EndDate" HeaderText="End Date" 
                  SortExpression="EndDate" DataFormatString="{0:d}" /&gt;               
              &lt;asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /&gt;  
          &lt;/Columns&gt;                        
      &lt;/asp:GridView&gt;
      &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
  
      &lt;br /&gt;
      &lt;h4&gt;Add New Term:&lt;/h4&gt;
      &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:DetailsView ID="addNewTerm" runat="server" 
              AutoGenerateRows="False" DataKeyNames="TermID" 
              DataSourceID="TermLinqDataSource" DefaultMode="Insert"&gt;
              &lt;FieldHeaderStyle Font-Bold="true" /&gt;
              &lt;Fields&gt;
                  &lt;asp:BoundField DataField="TermID" HeaderText="Term:" SortExpression="TermID" 
                      ReadOnly="True" /&gt;
                  &lt;asp:BoundField DataField="StartDate" HeaderText="Start Date:" 
                      SortExpression="StartDate" /&gt;
                  &lt;asp:BoundField DataField="EndDate" HeaderText="End Date:" 
                      SortExpression="EndDate" /&gt;
                  &lt;asp:CommandField ShowInsertButton="True" /&gt;
              &lt;/Fields&gt;
          &lt;/asp:DetailsView&gt;
      &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
      &lt;asp:LinqDataSource ID="TermLinqDataSource" runat="server" 
          ContextTypeName="CETMSClient.RegistraDCsDataContext" EnableDelete="True" 
          EnableInsert="True" EnableUpdate="True" TableName="Terms" 
          OrderBy="RowIndex desc" &gt;
      &lt;/asp:LinqDataSource&gt;
  </code></pre>