LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting only selected child from tree

I am trying to figure out how to only select the final children from a tree not to include parent tags.

 

0 Kudos
Message 1 of 8
(3,921 Views)
You could use the invoke node "Navigate Tree.Get Parent" to get the parent's tag.  Then use that information to strip out that part of the child tag from the string.
0 Kudos
Message 2 of 8
(3,907 Views)
but how do you prevent someone from selecting a parent? I need only the final child data to get passed on to another vi when they double click on it.
0 Kudos
Message 3 of 8
(3,902 Views)
You use the Navigate Tree get parent so you can extract the parent part from the value string. See the attached VI.
0 Kudos
Message 4 of 8
(3,893 Views)

You use the Navigate Tree get parent so you can extract the parent part from the value string. See the attached VI.

 

Ben

 

(sorry I hit the post instead of add attachment in my previous message)

0 Kudos
Message 5 of 8
(3,891 Views)

There is a right click menu setting of "Allow Selection of Parents" which you can uncheck.  But for some reason with your VI, if I check that, then nothing really gets selected.

 

Other odd things about your VI.  When I first open it and do a Ctrl-E to go to the block diagram, the block diagram doesn't show right away.  I have to click around to see it.  When I run it, when I click the C7 parent, the string shows up as C7, but with the others, it will show up as CC6, or CC5.

 

I'm not that familiar with tree controls, I'm just trying to learn more about them by helping to answer your question.  I would recommend that you look over that link to Lava in your other message thread where some VI's were posted to help handle tree controls.

 

EDIT:  For the items you want to be children, you need to right click them and set them as Child Only? to be able to select them when the Allow Selection of Parents is unchecked.

 

Hey Ben,  Isn't your reply saying the same thing I said in my reply earlier?

Message Edited by Ravens Fan on 12-15-2009 05:48 PM
0 Kudos
Message 6 of 8
(3,889 Views)

You need to right click on the child item and check "child item only". I only did it for the first few child item so you will not be able to select most of the item in the vi that I posted before you select "child item only". By doing this you cannot select the parents.

 

Ben

0 Kudos
Message 7 of 8
(3,883 Views)

Try the attached VI, it uses the event structure to catch a mouse down event on the tree control and converts the click coordinates to a tag and column, from which you can get just the string of the item selected. You need to check if the selected item's tag is not an empty string and the click was in bounds before getting the item string. Hope this is helps!

 

-RW

0 Kudos
Message 8 of 8
(3,869 Views)