Adding Nodes to a TreeView

  • Thread starter Thread starter sho_nuff
  • Start date Start date
S

sho_nuff

Question here:

I have been trying to find a way to add existing nested nodes to a
tree that already has nodes in it:

So, my tree looks like this:

-com
-foo
-goo
-blue
-true

then, i have a node that contains the following children:

-com
-foo
-goo
-blue
-NEW

i try adding this to the treeview's root and then i get two com trees
right next to each other. what algorithm do i need to insert this new
node properly so that the resulting treeview looks like:
-com
-foo
-goo
-blue
-true
-NEW


? Thanks in advance
 
You need a basic recursion algorithm that does updates of existing nodes and
inserts for nodes that don't already exist. This is called a merge, and
unfortunately
the TreeView doesn't already support a method for it.
 
yeah, i read that after i posted. anyone have a solid implementation
in C# that does this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top