The SubGraph at the top of Demo1 is a GoSubGraph… the base class with no customizations.
In my application
GoSubgraphBase derived object which is then added to view's document.
could you post before & after screenshots?
It appears the problem is that you have one or more complex nodes that are children of your GoSubGraph node.
GoSubGraph.Collapse will move the child nodes and make them not-Visible. It will also collapse nested subgraph nodes. But it won’t do anything else for other kinds of child nodes, so those ports will still be positioned separately from each other, if they had been separate when the child node had been visible.
So you should override the GoSubGraph.CollapseChild and ExpandChild methods to deal with your child nodes specially, in addition to the usual stuff by calling the base method.
Assuming your child nodes are instances of GoMultiTextNode, I think when collapsing, you’ll want to set GoMultiTextNode.ListGroup.TopIndex = 0 and change the height of the GoMultiTextNode.ListGroup to 0. That will cause GoListGroup to hide and superimpose all of its children, thereby getting all of the ports to be overlapping too on each side.
When expanding, set GoMultiTextNode.ListGroup.TopIndex = -1.