title: multi level parent child sorting
body: <p>I have a list of items</p>
  
  <ul>
  <li>ID             Name         ParentID</li>
  <li>1              abc             0         (level1)</li>
  <li>2              def             1    </li>
  <li>3              ghi             1    </li>
  <li>4              jkl             0        </li>
  <li>5              mno             2    </li>
  <li>6              pqr             5    </li>
  <li>7              aaa             1    </li>
  <li>8              vwx             0    </li>
  </ul>
  
  <p>I want the list to be sorted as</p>
  
  <p>abc,
  aaa,
  def,
  mno,
  ghi,
  jkl,
  vwx,</p>
  
  <p>that is i want parent (ascending order of name), its children (in ascending order of name), subchildren of children (ascending order of child) and so on till the last level and then again parent.
  I have </p>
  
  <pre><code>sections = new List&lt;section&gt;( from section in sections
                       group section by section.ParentID into children
                       orderby children.Key
                       from childSection in children.OrderBy(child =&gt; child.Name)
                       select childSection);
  </code></pre>
  
  <p>But sorts the list as
  abc, jkl, vwx, aaa, def, ghi, mno, pqr</p>
  
  <p>Can anybody let me know where am i going wrong.</p>