471,330 Members | 1,111 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Get data from IEnumerable. Loop.

Hello,

I found really useful Hierarchy extension (http://www.scip.be/
index.php?Page=ArticlesNET18) which I am using to load the categories
hierarchic structure from an Adjacency Model table.

So with my Linq query I get an object of type
IEnumerable<HierarchyNode<MyType>>

The result can be used as a ItemSource of an Asp.Net tree view but
this is not what I need.

I am trying to create two things:

1. Create a SelectList.

Each item has a name and a value:
value = MyType.ID
name = N nbsp; + MyType.Name
(N nbsp; are added before the name. N = Node Depth
which is given in each Hierarchy Node)

2. Create a Unordered List (Just a string containing the code). Just
an example of how it would look:

<ul id="Categories">
<li>Root 1</span>
<ul>
<li>Child 11
<ul>
<li>Child 111</li>
<li>Child 112</li>
</ul>
</li>
<li>Child 12</li>
</ul>
</li>
<li>Root 2
<ul>
<li>Child 21</li>
</ul>
</li>
</ul>

Could someone, please, help me out in creating this loops?

Thanks,
Miguel
Jun 27 '08 #1
0 875

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gordon Rundle | last post: by
3 posts views Thread by Oliver Gargour | last post: by
5 posts views Thread by Tin Gherdanarra | last post: by
1 post views Thread by =?Utf-8?B?RnJhbmNvaXNWaWxqb2Vu?= | last post: by
2 posts views Thread by Steve Richter | last post: by
8 posts views Thread by David | last post: by
2 posts views Thread by =?Utf-8?B?a2VubmV0aEBub3NwYW0ubm9zcGFt?= | last post: by
2 posts views Thread by Ronald S. Cook | last post: by
9 posts views Thread by K Viltersten | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.