Nevron Forum

Programmatically Show/Hide nodes in a tree

https://www.nevron.com/Forum/Topic6828.aspx

By Rotha Aing - Friday, August 17, 2012

Hi,

Is there a way to programmatically set nodes to either be expanded or collapsed? I would like to create some controls that will go through the diagram and expand certain nodes while leaving others collapsed.

Currently I am using the NShowHideSubtreeDecorator.

Thanks
By Nevron Support - Friday, August 17, 2012

You can use the ToggleState() method of the show/hide subtree decorator to achieve this:

showHideSubTreeDecorator.ToggleState();

document.SmartRefreshAllViews();

Note, that if you want to check if the decorator is currently expanded or not you can use its GetState() method.