Maybe you could get a little bit help of the vis I attached in this thread:
your example is very nice and my problem can be shown with it very easily:
1. Create a duplicate item entry under the item 1.1.1 (e.g. change 184.108.40.206 to 220.127.116.11 too)
2. Run your VI and you will see that there is read 18.104.22.168_1 for the second item.
How can this be avoided?
What you see in the tree is the item text. What you get in my vi is the item tag. The tag must be different in each node as this is used (I'm pretty sure about that) to identify the node. The text is just a graphical representation for the user. Here it doesn't matter if each node has the same text.
Could you describe a little bit more precise what you want to do? Double-click an item - and then?
I attach a little example how you could react on a double click.
i want to use the treeview control to show datasets. Within these datasets the first column has not to be unique and there is no restriction not to use an underscore within the text. If i use the tag information i don't now wether the underscore is added by addNode function or if it is part of the specified value for this field within the database. I case of a doubleclick i want to open a file and the filename sholud be built using the displayed text of the selected treeview item.
How can this be managed?
How do you insert data into the tree? Manually or by using the tree-methods (Add Item; Add Item at end...)?
If you do it programmatically you can set the tag yourself.
There is no way to specify the separator for the 'Add Item at end' method, there is always used the '_' followed by an automatically created index. The treeview is filled by myself, but how can i establish any relationship between the item string and the item tag?
You mentioned something about a database previously.
I modified my example, to be filled programmatically. I could imagine that this is something that could help you.
If you just want to change the tag, you could use the corresponding method.
i resolved my problem by manipulating the tag. If i add items to my treeview i use now the item string and a configurable speartor (e.g. ~) to create the string for the tag. If the tag already exists LabVIEW adds the '_' and an index. If i need the displayed string of an item i am always using only the first part of the tag string.
Thanks for your help!
Hm - sounds as if've found a way, but are not yet really satisfied with the solution.
I'm still wondering, why you have problems concerning the tags. These should be unique - this makes it easier for you to handle the items.
So if you still are interested in a maybe better solution, explain what you want to do as exactly as possible. You mentioned kind of a link between database fields and tags, but did not really clearify it. It's always hard to help, if one just knows a part of the problem.