From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there any easy way to reduce the time on updating tree control?

there are many items ready for insert into tree control. but it cost a lot of time to update the tree control.

I already know defer panel update to reduce this time like link below.

https://forums.ni.com/t5/LabVIEW/Defer-Panel-Update-Tree/m-p/4007139#M1145343

 

is there any other way to solve this problem?

0 Kudos
Message 1 of 3
(1,959 Views)

Another recent thread had this same topic.  I'd have to find the link.  It was a situation that had a few levels to the tree.  The recommendation was to only populate the top level, and perhaps a dummy item on the level below any line that had a branch below, that way it indicated with the + sign an item below.

 

Then use an event structure to detect if a branch was to be expanded.  If so, defer panel updates, populate the branch below with its items, turn off the panel defer, and allow the branch to open.  That way you only populate the tree with items that needed to be seen when they were needed.

0 Kudos
Message 2 of 3
(1,921 Views)

I also thought of the same post. This is the link: Display a huge list of elements: Tree control, ActiveX or something else that can be filtered? 

 

Depending on the OP's requirements, it might be useful (or not).

 

I'd guess you're already using the array inputs to add multiple (and not adding the items one at a time?)

You can also delete all elements and then use that to set new values, but if you're adding elements to the end that will be slower.

If you want to add to the middle, or various locations, I guess you'd have to profile individual adding vs adding all to the end then moving as needed vs deleting all and recreating by adding all to end (keeping an in-memory model).


GCentral
Message 3 of 3
(1,909 Views)