views:

26

answers:

1

I am getting following output in Dataset

ActivityID ParentActivityID ActivityName  AcivityLevel
0       NULL           Dashboard       0
1       NULL        Market Trends   0
2       1            News        1
3       NULL        Master        0
4       3            Products       1
5       3            Segments       1
6       3             Companies       1
7       NULL        Settings       0
8       7            Dashboard Settings  1

and I want to build HTML list as follow.

   <ul>
        <li>Dashboard</li>
        <li>Market Trends
            <ul>
              <li>News</li>
            </ul>
        </li>
        <li>Master
            <ul>
                <li>Products</li>
                <li>Segments</li>
                <li>Companies</li>
            </ul>
        </li>
        <li>Settings
            <ul>
                <li>Dashboard Settings</li>
            </ul>
        </li>
  </ul>

I am stuck upon Hierarchy and C# is new for me. Can anyone help me please? Thanks in Advance.

A: 

This link might solve your problem though the code is in java you may get the idea.

hib