LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tree controls has me stumped!

Solved!
Go to solution
I'm pretty new with tree controls so please bare with me. I'm trying to create a tree using an array. Each coloum represents a parent and the last coloum is the child. There are a number of entries that have the same parent. When I run my vi, it creates a new parent with the same name. I want to add the enty to the exsisting parrent. See the attached vi. Hope someone can help!
0 Kudos
Message 1 of 4
(3,090 Views)

I hope someone can give you a better answer. I don't have LV 2009 so I can't look at your code. 

 

Tree controls are not very intuitive. I had some difficulty with them. Then I discovered the Tree Controls API at LAVA. Give these a look. I found them to be quite helpful.

PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 2 of 4
(3,081 Views)

If you creat an element in a tree (with Add item), a tag is returned. Use this tag to create children, you can input it on the 'Add Item'.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 4
(3,066 Views)
Solution
Accepted by Joe_John

Try the attached vi, I think it's what you were trying to accomplish. The problem you were having was becuase you were adding items that already existed in the tree, so labview forces their item tags to <Item>_1, <Item>_2, etc. In the attached vi you'll see I check if the current item already exists, if it does, I don't add it. I also build the child tags as <col1>_<col2>_<col3>_... for each row so that I can check if the same element already exists. Hope this is what you were looking for!

 

-RW

0 Kudos
Message 4 of 4
(3,052 Views)