title: Paging List of Objects using LINQ
body: <p>I have a list of objects <code>List&lt;Parent&gt; Parents</code>.</p>
  <p>The <code>Parent</code> class has a <code>List&lt;Child&gt; Children</code>.</p>
  <p>Until now, I have applied paging to <code>Parents</code> using LINQ:</p>
  <p><code>List&lt;Parent&gt; PageX = Parents.Skip(PageIndex * PageSize).Take(PageSize);</code></p>
  <p>For instance, if PageSize=2, I have the following result:</p>
  <blockquote>
  <p>--------------- Page 1 ----------------------</p>
  <p><strong>Parent 1</strong></p>
  <p>Child 1</p>
  <p>Child 2</p>
  <p>Child 3</p>
  <p><strong>Parent 2</strong></p>
  <p>Child 1</p>
  <p>Child 2</p>
  <p>--------------- Page 2 ----------------------</p>
  <p><strong>Parent 3</strong></p>
  <p>Child 1</p>
  <p><strong>Parent 4</strong></p>
  <p>Child 1</p>
  <p>Child 2</p>
  </blockquote>
  <p>What I want to achieve is the following:</p>
  <blockquote>
  <p>--------------- Page 1 ----------------------</p>
  <p><strong>Parent 1</strong></p>
  <p>Child 1</p>
  <p>Child 2</p>
  <p>--------------- Page 2 ----------------------</p>
  <p>Child 3</p>
  <p><strong>Parent 2</strong></p>
  <p>Child 1</p>
  <p>--------------- Page 3 ----------------------</p>
  <p>Child 2</p>
  <p><strong>Parent 3</strong></p>
  <p>Child 1</p>
  </blockquote>
  <p>How can I achieve this?</p>