title: Telerik RadGrid Paging - Duplicate records and sticking buttons
body: <p>I've recently started using ASP.Net and Telerik's RadGrid but have ran into a problem:</p>
  <p>My RadGrid object is within a UserControl object within a Custom Control object within a Page object (which has a script manager).</p>
  <p>I have several UserControls within said Custom Control, each containing the markup for a RadGrid object as below:</p>
  <pre><code>&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;AreaListRadGrid.ascx.cs&quot; Inherits=&quot;WebControls.AreaListRadGrid&quot; %&gt;
  &lt;%@ Register TagPrefix=&quot;telerik&quot; Namespace=&quot;Telerik.Web.UI&quot; assembly=&quot;Telerik.Web.UI&quot; %&gt;
  
  &lt;telerik:RadAjaxPanel runat=&quot;server&quot; ID=&quot;radAjaxPanel&quot; 
              EnableAJAX=&quot;true&quot; LoadingPanelID=&quot;radAjaxLoadingPanel&quot;&gt;
      &lt;telerik:RadGrid AllowPaging=&quot;true&quot; AutoGenerateColumns=&quot;false&quot; DataSourceID=&quot;gridData&quot; EnableViewState=&quot;true&quot; GridLines=&quot;None&quot; ID=&quot;radGrid&quot; runat=&quot;server&quot;&gt;
          &lt;PagerStyle Mode=&quot;NumericPages&quot; /&gt;
          &lt;MasterTableView&gt;
              &lt;Columns&gt;
                  &lt;telerik:GridBoundColumn DataField=&quot;ColA&quot; HeaderText=&quot;A&quot; /&gt;
                  &lt;telerik:GridBoundColumn DataField=&quot;ColB&quot; HeaderText=&quot;B&quot; /&gt;
                  &lt;telerik:GridBoundColumn DataField=&quot;ColC&quot; HeaderText=&quot;C&quot; /&gt;
                  &lt;telerik:GridBoundColumn DataField=&quot;ColD&quot; HeaderText=&quot;D&quot; /&gt;
                  &lt;telerik:GridBoundColumn DataField=&quot;ColE&quot; HeaderText=&quot;E&quot; /&gt;
              &lt;/Columns&gt;
          &lt;/MasterTableView&gt;
      &lt;/telerik:RadGrid&gt;
  &lt;/telerik:RadAjaxPanel&gt;
  
   &lt;asp:ObjectDataSource  ID=&quot;gridData&quot; runat=&quot;server&quot;
                          SelectMethod=&quot;GetData&quot;
                          SelectCountMethod=&quot;GetDataCount&quot;
                          OnObjectCreating=&quot;dataObjectCreating&quot;
                          TypeName=&quot;AreaListRadGrid&quot;&gt;
  &lt;/asp:ObjectDataSource&gt;
  
  &lt;telerik:RadAjaxLoadingPanel runat=&quot;server&quot; ID=&quot;radAjaxLoadingPanel&quot;&gt;
          Loading please wait....
  &lt;/telerik:RadAjaxLoadingPanel&gt;
  </code></pre>
  <p>I've changed the names of columns and namespaces to something non-project specific, but the grid loads.</p>
  <p>As it's in a Custom Control, it is instantiated as follows:</p>
  <pre><code>var view = (AreaListRadGrid)this.TemplateControl.LoadControl(&quot;.\\WebControls\\AreaListRadGrid.ascx&quot;);
  view.DataSource = dataSet;
  areaCenterMiddle.Controls.Add(view);
  view.RadGrid.Rebind();
  </code></pre>
  <p>the <code>dataSet</code> variable is of type <code>System.Data.DataSet</code>.</p>
  <p>So, when I run this website, the Rad Grid appears. I've got a grid with 4 rows, 3 of which are on page 1 and the final row is on page 2.
  <img src="https://i.stack.imgur.com/iLiH1.png" alt="initial radgrid" />
  <img src="https://i.stack.imgur.com/ouWhh.png" alt="after page 2 click" />
  When I click page 2, everything happens as expected. The styling for for page buttons change, and the rows from page 1 are removed, with the row from page 2 added to the grid. Great! What happens next is what I don't understand:</p>
  <p>When page 1 is clicked again, the styling for the page 2 button dosn't change (so it's still as if it's clicked) and rows 2 and 3 appear on the grid, but the first row is the row which was on page 2.</p>
  <p><img src="https://i.stack.imgur.com/73NqE.png" alt="re-visit to page 1" /></p>
  <p>it seems as if page 2 is not clearing when page 1 is loaded, I'm not sure why or how this is, though. Anyone got any ideas to what I'm doing incorrectly?</p>
  <p>Would really appreciate your help.</p>
  <p>Cheers,</p>
  <p>Rob</p>