LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get all items under a parent item in a tree control

Hello,

 

I have 2 questions regarding a tree control:

 

1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22

 

2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3

 

Any ideas?

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

Mentos wrote:

1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22


 Did you try a search? There's no direct way of doing this. You have to navigate the tree and build up an array. You can find an example here: http://forums.ni.com/t5/LabVIEW/get-all-children-of-a-parent-in-tree/td-p/729548


2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3

No. (It's called ActiveCell, not ActiveCells) Presumably you are trying to perform an operation on multiple items. Unfortunately, you need to use a loop. You should defer panel updates if you're doing this a lot.

 

0 Kudos
Message 2 of 3
(3,481 Views)

Hi Smercurio,

 

1) I'm performing a search at the moment. It works fine but I was hoping for a more elegant method... I guess I'll have to stay with it.

 

2) That's too bad.

 

Thanks for the tips!

0 Kudos
Message 3 of 3
(3,475 Views)