-
I have a tv control which allows user to drag and drop
nodes to other nodes.
After they finish, how can I print the text according to
the sequence that they are displayed on the screen?
Also, can I use the indent property to knows the level
of indentation they are?
M Thanks
-
Use FullPath property
For determining the level of indentation you could use the FullPath property of a node. Count the number of occurences of the PathSeperator property of the treeview.
I asume you want to rebuild the tree exactly the same way as you left it. Consider using the .Parent.Key property. Store the Parent.Key property of node and do this for every node. Set tvwChild and twvFist/Last with checking of a node has childs and store all node settings accordingly.
I myself use a database to store all data but this is not a good procedure if you want to distribute your application over the Internet. I know all root nodes and just add nodes as twvchild to the right relative key.
-
Thanks Berthil,
I more or less can rebuild the tree now.
But I found another problem:
If I have 2 child to a parent, building the linking
from child to parent is OK, but how about the relative
position, ie. how can I know whether child A is before
child B?
Can you help?