LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an item in a tree control under (same hierarchy) selected/tagged item

Hi,

 

I would like to insert by "Add Segment" an additional item directly under the currently selected Segment B :

 

tbet_0-1630068882444.png

 

This is in general feasible with the AddItem Invoke Method :

 

tbet_1-1630068987651.png

In order to place the item in the same hierarchy I use the Invoke Method "Get Parent" - but of course the new item is then placed as the first one - and not _under_ the selected "Segment B" item - because ChildPosition is by default "0".

 

So my question is : How can I derive from the information that I have with regard to the selected/active Tag the Child Position ?

 

(or is there maybe another - smarter - way to do what I want to do : to insert on the same hierachy level an item _under_ the currently selected one)

 

0 Kudos
Message 1 of 2
(1,237 Views)

OK - found a way by "Search 1D array" on "All tags" property node for the selected tag : 

 

tbet_0-1630071595511.png

 

Maybe it might help others - therefore dropped it here ...


If there is a nicer / better way please let me know ...

0 Kudos
Message 2 of 2
(1,214 Views)