>>>I have been using the treeview.nodes.clear() method and am having performance issues. A treeview with about 300 items loads less than half a second on all machines, but issuing the clear() call takes about 2.5 seconds on my development machine and up to 2 minutes on some of the client machines. I can't imagine how populating a treeview can be so much faster than clearing it.
>>>
>>>Is there a workaround or advice on how to improve the performance? The machines are somewhat similar in hardware and speed.
>>>
>>>Troy
>>
>>Set the TreeView.Visible = .F. first.
>
>
>Thanks for the sugestion - it does make a significant difference on performance. I was using the lockform forgetting that active X controls do not always honor that setting.
Troy,
ActiveX controls are real Windows (unlike VFP's controls). Windows can only a single window's update at one time (which is what LockScreen does). The Treeview, however, has its own (undocumented) hWnd (window handle) property. You can lock a treeview update using the LockWindowUpdate() API call. I wrote about how to do this in a VFUG (
www.vfug.org) newsletter this year (June, I think). That article might be of interest.
George
Ubi caritas et amor, deus ibi est