From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree stops allowing selection of items after a while!

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

0 Kudos
Message 1 of 6
(2,801 Views)
The problem you are seeing appears to be due to turning off the "Allow Selection of Parent Items" in the Selection Mode menu.
Message 2 of 6
(2,795 Views)

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

0 Kudos
Message 3 of 6
(2,786 Views)
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!
0 Kudos
Message 4 of 6
(2,783 Views)

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

Richard
Message Edited by rgledhill on 11-25-2008 10:31 AM
0 Kudos
Message 5 of 6
(2,781 Views)

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

0 Kudos
Message 6 of 6
(2,708 Views)