11-22-2005 02:52 AM
11-22-2005 04:04 AM
Hi Sunny
Maybe you could get a little bit help of the vis I attached in this thread:
http://forums.ni.com/ni/board/message?board.id=170&message.id=111138
Thomas
11-22-2005 07:07 AM
Hi Thomas,
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 1.1.1.2 to 1.1.1.1 too)
2. Run your VI and you will see that there is read 1.1.1.1_1 for the second item.
How can this be avoided?
Regards,
Sunny
11-22-2005 08:04 AM
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.
Thomas
11-24-2005 12:54 AM
Hi Thomas,
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?
Reagards,
Sunny
11-24-2005 01:00 AM
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.
11-24-2005 07:52 AM
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?
Reagrds
Sunny
11-24-2005 08:08 AM
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.
Thomas
11-25-2005 03:38 AM
Hi,
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!
Regards,
Sunny
11-25-2005 03:46 AM
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.
Thomas