Is there any way to expand tree control branches through scripting? For example, using an excerpt from the manual:
![](https://global.discourse-cdn.com/inductiveautomation/original/1X/201365c29831be2652fcb8d7ebd3113c38747ebf.png)
Since East Area/Process/Valve 2 is in an alarm-type condition, I’d like that part of the tree to be opened up on an event. along with whatever other leaves that are in a “non-normal” condition.
Hope that just made sense. ![:unamused: :unamused:](https://emoji.discourse-cdn.com/twitter/unamused.png?v=9)
If you set the Selected Item property to some integer value >= 0 the tree will select the node at that location. The Selected Item value is the index into the dataset of the node you want to select. So, if you want to select the second row in the dataset you just set the Selected Item to a 1. Hope this helps.
Yep just figured out how to run 'em down. Now for the bonus question: Can I collapse the tree again, say, after an alarm is no longer valid?
That one is a little tricky, we don’t have any functions you can call to collapse it. I think you would just have to reload the dataset.