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. Image for the cookie policy date

Layout Manager Hierarchial Layout

Is there a way I can add all of my nodes to my DiagramWebControl, providing information in the Node object for which nodes have a parent/child node relationship and then call the layout manager to arrange those nodes?

Thanks,
Bryan


1 Reply

AD Administrator Syncfusion Team November 4, 2008 12:51 PM UTC

Hi Bryan,

The parent/child relationship formed in Layoutmanager is determined by the order in which lineconnector is added to the graph manager.

The rank is generated by the GraphLayoutManger for every nodes based on the line connection between the nodes.

Based on the rank, the layout manager will position the nodes.

To override the default behavior, you can inherit DirectedTreeLayout manager and override the methods DoGraphLayout(), MakeLayout(), NormalizeNodes() for positioning the nodes, as follows:

***********

protected override void DoGraphLayout()
{
Graph graph = this.SelectedNode as Graph;
if (graph.GraphType == GraphType.OneParentDirectedTree)
{
ArrayList lstToSort = graphToSort.TypeOrdered;
}
}

In this "ArrayList" sorts out the rank of every nodes.


Feel free to write to me if you need any further clarifications in this regard, Thanks!

Regards,
Ajeet


Loader.
Live Chat Icon For mobile
Up arrow icon