how to group data in a list
<p>I need  to group data of a list  in c#</p>

<p>ex: i have a data like this in a list c#  </p>

<p><strong>i have a class called information.cs  with these properties  name,school, parent</strong></p>

<p><strong>ex data</strong></p>

<pre><code> name    school  parent

kumar      fes         All

manju      fes         kumar

anu         frank       kumar

anitha      jss          All

rohit       frank       manju

anill        vijaya      manju

vani         jss          kumar

soumya   jss           kumar

madhu     jss          rohit

 shiva       jss          rohit

vanitha       jss          anitha
 anu      jss          anitha
</code></pre>

<p>now taking this as an input   i wanted the  output  to be formated with a Hierarchical data
 when parent is <strong>all</strong> means it  is the topmost level 
     <strong>kumar      fes         All</strong>. 
 what i need to do here is i need to create an object[0] and then check in list  whether kumar exists as a parent in   the list if it exista then add those items as  under the object[0] as a parent  </p>

<pre><code>i need  to create one more oject under
**manju      fes         kumar

anu         frank       kumar**
</code></pre>

<p>what i wanted do here is iterate through the list anD then check the parent level based on </p>

<p>name    school  parent</p>

<pre><code>kumar      fes         All --&gt;obj[0]

manju      fes         kumar --&gt;obj1[0]

anu         frank       kumar --&gt;obj1[1]
</code></pre>

<p>for obj1--> obj[0]  will be parent like this  i need  to genarte  a list or observation class</p>

<pre><code>    anitha      jss          All--&gt;obj[1]
   vanitha       jss          anitha --&gt;obj1[0]
       anu      jss           vanitha --&gt;obj2[0]
</code></pre>

<p>here <strong>obj2[0]-->obj1[0]-->obj[1]</strong> will be an parent</p>

<p>like this i need  to  create a list or an observationclass  hope my Question is clear what i am trying  ask you people.
i wanted  to know  how i can create  an observationclass. 
any help would be really great. </p>

<p>hope my question is  clear</p>
