Tree does not save position after ExpandTree/CollapseTree operation

When i try to collapse or expand a tree after moving the nodes, the tree always returns to the original position. Is there a way to to allow tree to stay at the position that was before the operation.

TreeExpander button sample


What is happening is that collapsing or expanding a (sub)tree causes some nodes and links to disappear or to appear. That causes the Diagram.layout to be invalidated, which causes another layout to be performed at the end of the transaction.

But you can control layout invalidation. Read about that at

I suspect you want to turn off the Part.LayoutHidden and Part.LayoutShown flags of the Part.layoutConditions property of both your Links and your Nodes.

Thanks that fixed it.