LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid Tree control expanding when written to?

Solved!
Go to solution

I'm using a tree control to display results from a database search among several tables, where each table is named in Indent level 0 in tree, and the search results at level 1. When I do the search, the tree is expanded automatically, which gets rather big because of hundreds of lines at level 1, and I want to expand each Item at my own will. Now I need to scroll down and close level 1 manually before doing that. I wonder if there is a property/setting to NOT expand indent levels when a Tree is written to? I've tried Active Item->Open? property to False, but it is still expanded. Is there a way to fix this issue?  

 

Regards

Bård B

0 Kudos
Message 1 of 5
(1,920 Views)
Solution
Accepted by topic author BBend

Use an invoke node.  You can either use the "Open/Close:Item" method after adding each item, or you can use the "Open/Close:All" after the tree is filled.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 5
(1,885 Views)

I also suggest calling the Defer Panel Updates property of the Panel class before/after every tree update, it will make your UI more responsive.

Message 3 of 5
(1,868 Views)

That did the trick!

Thanks for the help, guys!

0 Kudos
Message 4 of 5
(1,819 Views)

What specifically did the trick?  Defer front panel updates, or the suggestion about the Close item?

0 Kudos
Message 5 of 5
(1,809 Views)