Results 1 to 3 of 3

Thread: TreeView Loading

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    14

    Cool TreeView Loading

    Hey there,

    I seem to be at heads with a bit of a speed problem with the treeview control. I have a sturcture recived from an API which is basically

    Code:
    ROOT NODE
       - Parent
              - Child
              - Child
              - Child
                     - Child
                     - Child
              - Child
        - Parent
    The structre is made up of about 2200 items onthis particully repositry. And the filling routine is a very fast resurive some - but it takes a collection of treeview because 5 have to be filled at once.

    I have removed all sorting on load from the control - and all new nodes created - in favor of a "at end sort" like this.

    VB Code:
    1. Public Sub SortTree(colTree As Collection)
    2.     Dim TreeV As TreeView
    3.     Dim TNode As MSComctlLib.Node
    4.    
    5.     For Each TreeV In colTree
    6.    
    7.         For Each TNode In TreeV.Nodes
    8.             If TNode.Children > 1 Then
    9.                 TNode.Sorted = True
    10.             End If
    11.         Next
    12.     Next
    13. End Sub

    The problem is when loading - it files up to about 1000 nodes bout 1000-2000 nodes it seems to crawl and get progessivly slower. So is there any tips for overcomthing this - or is the treeview control not made for this load?

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Location
    India
    Posts
    97
    The treeview control is limited to a max of some 2000 or so anything near this no will make it extremely slow.
    As far as I know you have to use a 3rd party tool for your app
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
    Dont quote anyone if you can help it -
    THM
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    14
    Right - thought so. I fixed the loading problem. A Do Events in a loop was progressily eatin CPU time or something slowing the loading to a crawl. Really strage but takin it out made a HUGE reduction.

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