|
-
Sep 3rd, 2002, 10:10 AM
#1
Thread Starter
New Member
Adding files to a treeview in a hierarchal format
Hi,
Does anyone know how can I add files like “C:\temp\help.txt” in the format of
temp
help.txt
in a treeview. It should be dynamic, that is, I can also add “C:\temp\now\read.txt” and it should add it to
temp
now
read.txt
help.txt
anyone knows how to do this?
Thank you,
Bob
-
Sep 3rd, 2002, 11:35 AM
#2
-
Sep 3rd, 2002, 02:49 PM
#3
Thread Starter
New Member
Changes Needed
Can this code be refined so that all the folders are listed first in the treeview and then the files? Because if I insert "C:\temp\fun.txt" this is listed before "C:\temp\zee\name.txt".
Thank you,
Bob
-
Sep 3rd, 2002, 03:19 PM
#4
I'm not sure I follow you. The files and folders are listed in a hierarchy so if a file and folder share the same parent then they are both equally listed below that parent.
-
Sep 3rd, 2002, 03:58 PM
#5
Here is what it looks like for me:

You can sort it using the sort property of the treeview. Or maybe you mean you want all the folders to be on top of any files when they are on the same level. If so then you'd have to use Insert instead of add and work out some way of knowing where to put it.
-
Sep 3rd, 2002, 04:54 PM
#6
Thread Starter
New Member
Other way round
Hi,
Yes, I wanted the folders first and then the files. Like in your example you have the file 040D.CS_ before the “lang” folder. I wanted the folders first. But, it is okay I figured it out. Thank you so much for your help.
Now, I need to know to go back again. That is, if the user selects a node in the treeview and clicks the remove button all the nodes and child nodes are deleted from the treeview and their full names are inserted in a list box.
For example, if someone selects the “lang” node and clicks remove, all the nodes and child nodes are deleted from the treeview and,
“C:\I386\lang\HEB\MRIAMTR.TT_”
“C:\I386\lang\UNIPROC\MP2UP.INF”
Should be added to a list box.
Thank you,
Bob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|