It takes 3 seconds to empty treeview...
Author |
Message |
Mikael Till #1 / 14
|
 It takes 3 seconds to empty treeview...
When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes over 3 seconds to delete 420 nodes... This is far to long time, when it takes the same time to query the database and fill it up again! It has to be another way to emptu the treeview! Please advice! /Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
Mark Winsal #2 / 14
|
 It takes 3 seconds to empty treeview...
I also posted a message on this subject in a few groups but got no response. What I found was that since the upgrade to 5.0 this control has become ridiculously slow. With some playing around I have found two things: 1. More than about 128 nodes causes it to slow dramatically 2. If you make the visible property false while doing operations such as fill, clear, expand (globally) you will see a big improvement in performance. Unfortunately for me, even if I do (2) when filling the tree, when the control releases control back to me, it still takes a lot of time to stop "processing?" something. That is to say, I have regained control and in debug see that program has started the next step, but the TreeView is still doing something that can take 10 to 20 seconds if I have a few hundred nodes. Just as a side line, the whole reason I upgraded to 5.0 initially was because this control did not work when I upgraded the MSN a few months ago. So I got 5.0, expecting this would cure the problem, it did but at the price that this very useful control became almost disfunctional for large data sets. (Contact me directly if you would like more info Mikeal) Quote:
>When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes >over 3 seconds to delete 420 nodes... This is far to long time, when it >takes the same time to query the database and fill it up again! It has to be >another way to emptu the treeview! >Please advice! >/Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
Shawn Wood #3 / 14
|
 It takes 3 seconds to empty treeview...
Mark, Consider loading your treeview on a background thread. At least you get control back immediately this way! (Disclaimer: Depending on the complexity of your project, other issues may be introduced.) Shawn Woods
Quote: > I also posted a message on this subject in a few groups but got no response. > What I found was that since the upgrade to 5.0 this control has become > ridiculously slow. With some playing around I have found two things: > 1. More than about 128 nodes causes it to slow dramatically > 2. If you make the visible property false while doing operations such as > fill, clear, expand (globally) you will see a big improvement in > performance. > Unfortunately for me, even if I do (2) when filling the tree, when the > control releases control back to me, it still takes a lot of time to stop > "processing?" something. That is to say, I have regained control and in > debug see that program has started the next step, but the TreeView is still > doing something that can take 10 to 20 seconds if I have a few hundred > nodes. > Just as a side line, the whole reason I upgraded to 5.0 initially was > because this control did not work when I upgraded the MSN a few months ago. > So I got 5.0, expecting this would cure the problem, it did but at the price > that this very useful control became almost disfunctional for large data > sets. > (Contact me directly if you would like more info Mikeal)
> >When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes > >over 3 seconds to delete 420 nodes... This is far to long time, when it > >takes the same time to query the database and fill it up again! It has to > be > >another way to emptu the treeview! > >Please advice! > >/Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
David Phillip #4 / 14
|
 It takes 3 seconds to empty treeview...
I have heard (but not verified) that the treeview control can be cleared faster if you MANUALLY remove each node. You might give this a try. Good luck David Phillips
Quote: > I also posted a message on this subject in a few groups but got no response. > What I found was that since the upgrade to 5.0 this control has become > ridiculously slow. With some playing around I have found two things: > 1. More than about 128 nodes causes it to slow dramatically > 2. If you make the visible property false while doing operations such as > fill, clear, expand (globally) you will see a big improvement in > performance. > Unfortunately for me, even if I do (2) when filling the tree, when the > control releases control back to me, it still takes a lot of time to stop > "processing?" something. That is to say, I have regained control and in > debug see that program has started the next step, but the TreeView is still > doing something that can take 10 to 20 seconds if I have a few hundred > nodes. > Just as a side line, the whole reason I upgraded to 5.0 initially was > because this control did not work when I upgraded the MSN a few months ago. > So I got 5.0, expecting this would cure the problem, it did but at the price > that this very useful control became almost disfunctional for large data > sets. > (Contact me directly if you would like more info Mikeal)
> >When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes > >over 3 seconds to delete 420 nodes... This is far to long time, when it > >takes the same time to query the database and fill it up again! It has to > be > >another way to emptu the treeview! > >Please advice! > >/Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
Shawn Stumbaug #5 / 14
|
 It takes 3 seconds to empty treeview...
Hi, I've also "heard" that setting the sorted property to false also speeds things up :0) Hope this helps! Shawn Quote:
> I have heard (but not verified) that the treeview control can be cleared > faster if you MANUALLY remove each node. You might give this a try. > Good luck > David Phillips
> > I also posted a message on this subject in a few groups but got no > response. > > What I found was that since the upgrade to 5.0 this control has become > > ridiculously slow. With some playing around I have found two things: > > 1. More than about 128 nodes causes it to slow dramatically > > 2. If you make the visible property false while doing operations such > as > > fill, clear, expand (globally) you will see a big improvement in > > performance. > > Unfortunately for me, even if I do (2) when filling the tree, when the > > control releases control back to me, it still takes a lot of time to stop > > "processing?" something. That is to say, I have regained control and in > > debug see that program has started the next step, but the TreeView is > still > > doing something that can take 10 to 20 seconds if I have a few hundred > > nodes. > > Just as a side line, the whole reason I upgraded to 5.0 initially was > > because this control did not work when I upgraded the MSN a few months > ago. > > So I got 5.0, expecting this would cure the problem, it did but at the > price > > that this very useful control became almost disfunctional for large data > > sets. > > (Contact me directly if you would like more info Mikeal)
> > >When I use the CLEAR metod for the NODES collection in TREEVIEW, it > takes > > >over 3 seconds to delete 420 nodes... This is far to long time, when it > > >takes the same time to query the database and fill it up again! It has > to > > be > > >another way to emptu the treeview! > > >Please advice! > > >/Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
(Bradley Reaves #6 / 14
|
 It takes 3 seconds to empty treeview...
I second that suggestion. I have found that when clearing the nodes manually it is faster. On Fri, 24 Apr 1998 07:29:03 -0700, "David Phillips" Quote:
>I have heard (but not verified) that the treeview control can be cleared >faster if you MANUALLY remove each node. You might give this a try. >Good luck >David Phillips
>> I also posted a message on this subject in a few groups but got no >response. >> What I found was that since the upgrade to 5.0 this control has become >> ridiculously slow. With some playing around I have found two things: >> 1. More than about 128 nodes causes it to slow dramatically >> 2. If you make the visible property false while doing operations such >as >> fill, clear, expand (globally) you will see a big improvement in >> performance. >> Unfortunately for me, even if I do (2) when filling the tree, when the >> control releases control back to me, it still takes a lot of time to stop >> "processing?" something. That is to say, I have regained control and in >> debug see that program has started the next step, but the TreeView is >still >> doing something that can take 10 to 20 seconds if I have a few hundred >> nodes. >> Just as a side line, the whole reason I upgraded to 5.0 initially was >> because this control did not work when I upgraded the MSN a few months >ago. >> So I got 5.0, expecting this would cure the problem, it did but at the >price >> that this very useful control became almost disfunctional for large data >> sets. >> (Contact me directly if you would like more info Mikeal)
>> >When I use the CLEAR metod for the NODES collection in TREEVIEW, it >takes >> >over 3 seconds to delete 420 nodes... This is far to long time, when it >> >takes the same time to query the database and fill it up again! It has >to >> be >> >another way to emptu the treeview! >> >Please advice! >> >/Tilly
|
Tue, 10 Oct 2000 03:00:00 GMT |
|
 |
Grishko Alexand #7 / 14
|
 It takes 3 seconds to empty treeview...
try to use API function Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long with hWnd of your treeview to disable redrawing treeview control before updating nodes collection and with 0 to enable redrawing after opdationg nodes -- Alexandr Grishko
Quote: > When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes > over 3 seconds to delete 420 nodes... This is far to long time, when it > takes the same time to query the database and fill it up again! It has to be > another way to emptu the treeview!
|
Thu, 12 Oct 2000 03:00:00 GMT |
|
 |
Kevin Buch #8 / 14
|
 It takes 3 seconds to empty treeview...
With TheTree.Nodes For LCV = .Count To 1 Step -1 .Remove LCV Next LCV End With MUCH faster. On Fri, 24 Apr 1998 10:54:34 -0700, "Mikael Tilly" Quote:
>When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes >over 3 seconds to delete 420 nodes... This is far to long time, when it >takes the same time to query the database and fill it up again! It has to be >another way to emptu the treeview! >Please advice! >/Tilly
-Kevin Buchan Senior Developer Premier Service Systems, Inc.
|
Fri, 13 Oct 2000 03:00:00 GMT |
|
 |
Roy Soltof #9 / 14
|
 It takes 3 seconds to empty treeview...
This is the code snippet I use to clear an array of treeview objects to eliminate the delay while the screen would be updated after every node was eliminated. For Each myobject In tvwn With myobject .Visible = False ' This speeds up the nodes.clear .Nodes.Clear .Visible = True End With Next Quote:
>I also posted a message on this subject in a few groups but got no response. >What I found was that since the upgrade to 5.0 this control has become >ridiculously slow. With some playing around I have found two things: >1. More than about 128 nodes causes it to slow dramatically >2. If you make the visible property false while doing operations such as >fill, clear, expand (globally) you will see a big improvement in >performance. >Unfortunately for me, even if I do (2) when filling the tree, when the >control releases control back to me, it still takes a lot of time to stop >"processing?" something. That is to say, I have regained control and in >debug see that program has started the next step, but the TreeView is still >doing something that can take 10 to 20 seconds if I have a few hundred >nodes.
|
Fri, 13 Oct 2000 03:00:00 GMT |
|
 |
Brian Web #10 / 14
|
 It takes 3 seconds to empty treeview...
I use an array. TreeView(0) is always invisible. II use TreeView(1) as my active tree. When its time to empty, I get rid of Tree(1). Then clear all references to it. Then recreate TreeView(1). Poof! Empty tree. Not great, but easy. Brian Webb
Quote:
>Hi, >I've also "heard" that setting the sorted property to false also speeds things >up :0) >Hope this helps! >Shawn
>> I have heard (but not verified) that the treeview control can be cleared >> faster if you MANUALLY remove each node. You might give this a try. >> Good luck >> David Phillips
>> > I also posted a message on this subject in a few groups but got no >> response. >> > What I found was that since the upgrade to 5.0 this control has become >> > ridiculously slow. With some playing around I have found two things: >> > 1. More than about 128 nodes causes it to slow dramatically >> > 2. If you make the visible property false while doing operations such >> as >> > fill, clear, expand (globally) you will see a big improvement in >> > performance. >> > Unfortunately for me, even if I do (2) when filling the tree, when the >> > control releases control back to me, it still takes a lot of time to stop >> > "processing?" something. That is to say, I have regained control and in >> > debug see that program has started the next step, but the TreeView is >> still >> > doing something that can take 10 to 20 seconds if I have a few hundred >> > nodes. >> > Just as a side line, the whole reason I upgraded to 5.0 initially was >> > because this control did not work when I upgraded the MSN a few months >> ago. >> > So I got 5.0, expecting this would cure the problem, it did but at the >> price >> > that this very useful control became almost disfunctional for large data >> > sets. >> > (Contact me directly if you would like more info Mikeal)
>> > >When I use the CLEAR metod for the NODES collection in TREEVIEW, it >> takes >> > >over 3 seconds to delete 420 nodes... This is far to long time, when it >> > >takes the same time to query the database and fill it up again! It has >> to >> > be >> > >another way to emptu the treeview! >> > >Please advice! >> > >/Tilly
|
Sat, 14 Oct 2000 03:00:00 GMT |
|
 |
Michael Livingsto #11 / 14
|
 It takes 3 seconds to empty treeview...
Alexandr, I USED to have the same problem Mikael did. Excellent technique! Gratefully yours, Michael Quote:
>try to use API function >Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As >Long >with hWnd of your treeview >to disable redrawing treeview control before updating nodes collection >and with 0 to enable redrawing after opdationg nodes >-- >Alexandr Grishko
>> When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes >> over 3 seconds to delete 420 nodes... This is far to long time, when it >> takes the same time to query the database and fill it up again! It has to >be >> another way to emptu the treeview!
|
Mon, 16 Oct 2000 03:00:00 GMT |
|
 |
Michael Livingsto #12 / 14
|
 It takes 3 seconds to empty treeview...
Alexandr, I USED to have the same problem that Mikael does. Excellent technique! Gratefully yours, Michael Quote:
>try to use API function >Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As >Long >with hWnd of your treeview >to disable redrawing treeview control before updating nodes collection >and with 0 to enable redrawing after opdationg nodes >-- >Alexandr Grishko
>> When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes >> over 3 seconds to delete 420 nodes... This is far to long time, when it >> takes the same time to query the database and fill it up again! It has to >be >> another way to emptu the treeview!
|
Mon, 16 Oct 2000 03:00:00 GMT |
|
 |
Mikael Till #13 / 14
|
 It takes 3 seconds to empty treeview...
Thanx! Now it takes 0,05s to emty it... Mikael Tilly Quote:
>I also posted a message on this subject in a few groups but got no response. >What I found was that since the upgrade to 5.0 this control has become >ridiculously slow. With some playing around I have found two things: >1. More than about 128 nodes causes it to slow dramatically >2. If you make the visible property false while doing operations such as >fill, clear, expand (globally) you will see a big improvement in >performance. >Unfortunately for me, even if I do (2) when filling the tree, when the >control releases control back to me, it still takes a lot of time to stop >"processing?" something. That is to say, I have regained control and in >debug see that program has started the next step, but the TreeView is still >doing something that can take 10 to 20 seconds if I have a few hundred >nodes. >Just as a side line, the whole reason I upgraded to 5.0 initially was >because this control did not work when I upgraded the MSN a few months ago. >So I got 5.0, expecting this would cure the problem, it did but at the price >that this very useful control became almost disfunctional for large data >sets. >(Contact me directly if you would like more info Mikeal)
>>When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes >>over 3 seconds to delete 420 nodes... This is far to long time, when it >>takes the same time to query the database and fill it up again! It has to >be >>another way to emptu the treeview! >>Please advice! >>/Tilly
|
Sat, 21 Oct 2000 03:00:00 GMT |
|
 |
Jerr #14 / 14
|
 It takes 3 seconds to empty treeview...
Since LockWindowUpdate couses repaint of all desktop with 0 parameter which can be flickering on stressed system I prefere to use the following: 'Freeze control SendMessageLong Ctl.hwnd, WM_SETREDRAW, 0, 0 'Do cleanup... '.... 'Unfreeze control SendMessageLong Ctl.hwnd, WM_SETREDRAW, 1, 0
Quote: > try to use API function > Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As > Long > with hWnd of your treeview > to disable redrawing treeview control before updating nodes collection > and with 0 to enable redrawing after opdationg nodes > -- > Alexandr Grishko
> > When I use the CLEAR metod for the NODES collection in TREEVIEW, it takes > > over 3 seconds to delete 420 nodes... This is far to long time, when it > > takes the same time to query the database and fill it up again! It has to > be > > another way to emptu the treeview!
|
Sat, 21 Oct 2000 03:00:00 GMT |
|
|
|