LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show expand/collapse icon in tree control

Hello;

 

I have to build a tree control with a lot of items reading from a database. If i read all at the beginning it needs a lot of time to create the tree so I only charge the Parents and, If  I double click in the item I do the query to the database to charge the childs.

 

The problem is that if I don't double click in the item idon´t have the expand/collapse icon (because there aren´t childrens yet) until I double click on it to get the childrens.

 

Is there any way to show the expand/collapse icon without childrens in the parent?

 

Thanks;

 

Sin título.jpg

Image and video hosting by TinyPic
<script type="text/javascript" async src="//cdn.youracclaim.com/assets/utilities/embed.js"></script>
0 Kudos
Message 1 of 5
(4,095 Views)

anderg wrote:

Is there any way to show the expand/collapse icon without childrens in the parent?


I'm not sure (probably not), but you can fill two levels rather than just the top level. When the user opens an item, you populate the all children of that item, so that they all have their children. This takes however long it takes, but because it's only the children of one item, it's not as long as populating the entire tree.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(4,073 Views)

A workaround might be to add an empty child item when you create the tree.  This will cause the expand symbol to be visible.  After clicking the expand symbol, the empty item is deleted and the database entries are populated in its place. 

aputman
0 Kudos
Message 3 of 5
(4,049 Views)

The problem is that there is no way (no event ) to detect when the user clicks on the expand symbol

 

Maybe i'm wrong and there is a way to detect that event...

Thanks

Image and video hosting by TinyPic
<script type="text/javascript" async src="//cdn.youracclaim.com/assets/utilities/embed.js"></script>
0 Kudos
Message 4 of 5
(4,023 Views)

@anderg wrote:

The problem is that there is no way (no event ) to detect when the user clicks on the expand symbol


You have two events: Item Open? and Item Open.


___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(4,018 Views)