We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to arrange/re-arrange the diagram nodes automatically in some standard manner?


The various diagram layout managers that are shipped with the Diagram can be used to arrange/layout the nodes in the specified format. Please refer the samples under Diagram Samples/Layout Managers category to get the details about the various layout mangers and how to use this in a diagram application to arrange the nodes.

Below code snippet shows how to apply the layout mechanism on the diagram nodes.


LayoutManager manager = new DirectedTreeLayoutManager(this.diagram.Model, 0,60,80 );

this.diagram.LayoutManager = manager;


Private manager As LayoutManager = New DirectedTreeLayoutManager(Me.diagram.Model, 0,60,80)

Me.diagram.LayoutManager = manager

Once the layout manager has been assigned to the diagram, we can use either the LayoutManager.UpdateLayout() or LayoutManager.AutoLayout() to arrange the nodes in the specified layout.

The following code snippet shows how to arrange the nodes that are added/present in the diagram.




this.diagram.LayoutManager.Nodes.AddRange(this.diagram.Model.Nodes );

// Updates the layout of the nodes in the model.







'' Updates the layout of the nodes in the model.



The following code snippet shows how to arrange the nodes as soon as that are added to the diagram.


this.diagram.LayoutManager.AutoLayout = true;


Me.diagram.LayoutManager.AutoLayout = True

Syncfusion Inc.

Article ID: Published Date: Last Revised Date: Platform: Control:
227 04/30/2011 07/10/2014 WinForms Diagram
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon