11-25-2008 08:56 AM
Hello all,
Having some problems with the tree control (Modern version) in LV 8.6, running under Vista SP1. It all starts fine, but then while working with it, at some point it will stop allowing me to select an item in the tree! Consequently I get no more events for "value changing", and the line is highlighted around the edge but the item itself isn't highlighted.
Frustratingly it works initially but then suddenly goes into this strange behaviour.
I have to say that generally this control is way below par - it's difficult to use, the drag'n'drop within the box to order items is buggy and inconsistent (e.g. can't move an item to the very top of the list), you can't read a numeric ID corresponding to the index (you just get the text back which is really unhelpful for big lists). Some work required on this please NI.
I've attached an empty VI which does nothing. In fact, it should echo the selected line of a tree to a string control, but as it doesn't work, it does nothing.
Help much appreciated...
Best regards
Richard
11-25-2008 09:47 AM
11-25-2008 10:02 AM
Hello,
Many thanks for the quick response - and you're spot on, this is what has caused the problems. However, I need this to be disabled, as I only want the user to be able to select the child items (i.e. indented by 1) as the parent items are purely to categorise the child items.
Any further help is much appreciated,
Best regards
Richard
11-25-2008 10:16 AM
11-25-2008 10:30 AM - edited 11-25-2008 10:31 AM
Grr!! I wanted to edit the previous post to add an extra bit in and timed out on me!! Obviously not my day... anyhow here is the correction I wanted to make:
-----
Just found the "Active Item -> Row Number" so please ignore the bit about not being able to read back an index number 🙂 Like many things in LabVIEW, it's there but you have to dig really deep!
Addendum: however this doesn't work either 😞 It comes out with:
Error 1135 occurred at Property Node (arg 2) in TreeBug.vi
Possible reason(s):
LabVIEW: The tree control's active item is not valid for this property.
Property Name: Active Item:Indent Level
All I'm trying to do is read this property from the tree when the value changes... This works in the file list tree demo (Tree Enhancements.vi, from the NI website) but doesn't work on my straight text tree...
Thanks
Richard12-10-2008 03:33 AM
Hi Richard,
The reason you were seeing this error is because you haven't set the Active Item Tag.
By setting this you will be able to access the properties as you would expect.
I have attached a modified version of your code demonstrating this.
Hope this helps.
Steve