Links layer in GoSubGraph?


#1

I used GoDocument LinksLayer property to put all the links below the nodes - CreateNewLayerBefore(Layers.Default).

The problem is that the links in the sub graphs are sometime drawn after the nodes.

I want the same behavior for sub graphs as for the main document: layers to be drawn below the nodes. How can this be done?

Thanks for your help.


#2

If you are adding an IGoLink object to a GoSubGraph (or any other GoGroup, actually), you want to make sure it is drawn before (i.e. behind) the other children in the subgraph. Instead of calling GoGroup.Add(…), call GoGroup.InsertBefore(null, …).


#3

There is also a posibility to move objects around something like MoveBefore(…)?


#4

You can use the InsertBefore or InsertAfter methods for objects that already belong to the group–that will just change the order.


#5

Perfect! Thanks