LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Control value adding an unexpected suffix

Solved!
Go to solution

Hello,

 

I'm wondering if someone has seen this before.

 

If I add a child item with the same string as a parent to a tree control, when I read from the control, it adds a '_1' despite displaying correctly.

 

This has obviously broken my app. I can't think of an easy workaround since the child item may well end in _1 in my context.

 

Any ideas?

 

niNickC_0-1632738919767.png

 

Nick
0 Kudos
Message 1 of 3
(1,082 Views)
Solution
Accepted by niNickC

That's how a tree control works. You are reading the tag, not the string of the left cell. Create an output from the "Edit Tree Items.Add to End" and you will see the tag that the item gets. Usually what you do is you gather the items with their tags and reference the tags to get the values out. I suggest looking at e.g. Tree Map for a simpler usage of a tree.

Certified LabVIEW Architect
Message 2 of 3
(1,066 Views)

Thanks for this.

 

I don't really want to refactor this particular module... I guess I can just read the text from the active cell rather than the tag (which is what is present at the terminal).

Nick
0 Kudos
Message 3 of 3
(1,062 Views)