Hi, I wonder if anyone can help me with this problem:
I've created a list with 3 references: parent, child and level reference.
The level indicates where the parent is located, for example: if the level is 0, it means that it's followed parent is located at the first column of the tree. If the level is 1, it's a child from some parent in the level 0 and it must appear at the second column followed by it's parent.
it's a little complicated to explain... the information is organized like an ordinary tree from Windows XP Explorer TreeView. Each parent might or might not have a child and the child might or not have a another child ....
The problem is: I have to organize the information from this list in another list that contains a folder name and the level of this folder. Then I can supply a method that build the treeview by the order of the information in the list.
If I wasn't clear enough I can post a print screen later.
3 replies to this topic
#1
Posted 08 November 2010 - 02:40 PM
|
|
|
#2
Posted 09 November 2010 - 01:08 PM
You can create the tree by sorting the original list ascending by depth (i.e. level). Then traverse the list and add each item into the tree, which you can positively do because node's parent must have smaller level than the node, and hence parent node can be found in part of the tree which has already been built.
#3
Posted 10 November 2010 - 05:07 AM
Zoranh, thank you for your response.
I'm newbie, so if a ask stupid questions, forgive me, ehehhe
I looked at the sort method and I couldn't find a way to sort it in the right way.
I posted a print of the list. How can I do it in C#?
All the best.
I'm newbie, so if a ask stupid questions, forgive me, ehehhe
I looked at the sort method and I couldn't find a way to sort it in the right way.
I posted a print of the list. How can I do it in C#?
All the best.
Attached Files
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top










