title: Retrieving all GridViewRow objects from a GridView control with paging enabled
body: <p>I currently have a GridView control on my aspx page with paging enabled and I need to loop through the entire row collection/count to process the selected records.  With my current code, it will only loop through the current page of GridView row.</p>
  
  <p>What is the best way to accomplish this task?  </p>
  
  <p>Here is my current code:</p>
  
  <p>ASPX page:</p>
  
  <pre><code>&lt;asp:GridView ID="MyGridView" runat="server" AllowPaging="true" PageSize="20"&gt;
     &lt;Columns&gt;
        &lt;!-- My Column list --&gt;
     &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;asp:Button id="MyButton" runat="server" Text="Add" OnClick="MyButton_Click" /&gt;  
  </code></pre>
  
  <p>code behind:</p>
  
  <pre><code>protected void MyButton_Click(object sender, EventArgs e)
  {
      for (int Count = 0; Count &lt; MyGridView.Rows.Count; Count++)
      {
          //The row count is 20 and only contains the GridViewRow object in the current page view  
          //I want to retrieve the all GridViews rows so I can add them to a ReorderList control
      }   
  }
  </code></pre>