Results 1 to 6 of 6

Thread: Adding files to a treeview in a hierarchal format

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    11

    Exclamation 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

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    11

    Exclamation 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

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    11

    Exclamation 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
  •  



Click Here to Expand Forum to Full Width