Results 1 to 4 of 4

Thread: Treeview Control PLEASE PLEASE HELP!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2001
    Posts
    24

    Exclamation Treeview Control PLEASE PLEASE HELP!


    Can somebody please help me. This is probably a really simple problem but i just cant solve it! I will try and explain what i am trying to do. The user can set up departments...from each departments different tree data is loaded from a database. The problem im having at the moment is a) Moving nodes up and down and having that change saved in the database so that its always the same and b) (the cruicial one) When a node is deleted any nodes under the one being deleted will be moved to a default department. I just cant figure out how to do it..i mean if there are 6 folders under the folder being deleted and lots of items within those 6 folders, how do i loop through each one and change the Department name for EACH item?

    If anyone can help i will be VERY VERY thankful.

  2. #2
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724
    its not petty clear but i will try out...

    when u delete a node.. are u using treeview1.nodes.remove to remove it at the same thime u can add node under the respected department..... or if u have a small tree and can afford to load again.. make the database changes and refresh the tree....

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2001
    Posts
    24
    I will try and make it clearer. I have a combo box with the departments in it...the user selects a department and then all of the information from the database where the department is the one they selected is displayed in the tree.... i.e...

    Master Folder 1
    Master Sub Item 1
    File 1
    File 2
    File 3
    Sub Sub Item 2
    Another Item 1
    Another Item 2
    Master Sub Item 2

    etc etc etc...... (sorry for the rubbish description!)

    ok so....if the user wants to delete Master Sub Item 1 but wants ALL of the other items under that folder MOVED to 'Default Department' how can i do that?

    what i was going to do was to make the changes in the database and then re-load the tree, but i cant see how to loop through all of the effected treeitems to find they key for each one to change in the database??

    Does any of that make sence?
    Last edited by boylesw; Mar 15th, 2003 at 05:26 AM.

  4. #4
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724
    that database are u using.....

    u mean when a parent node is deleted then all the childs content should be moved to the some 'xxx node... right

    if u are using MSSQL u have "Expanding Hierarchies" which gives the childs nifo..... u n update a bit to handle ur case

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