Back to Devexpress

DiagramControl.ApplyTreeLayout(Direction, IEnumerable<DiagramItem>) Method

windowsforms-devexpress-dot-xtradiagram-dot-diagramcontrol-dot-applytreelayout-x28-devexpress-dot-diagram-dot-core-dot-direction-system-dot-collections-dot-generic-dot-ienumerable-devexpress-dot-xtradiagram-dot-diagramitem-x29.md

latest3.4 KB
Original Source

DiagramControl.ApplyTreeLayout(Direction, IEnumerable<DiagramItem>) Method

Applies the tree layout algorithm.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
public void ApplyTreeLayout(
    Direction direction,
    IEnumerable<DiagramItem> items = null
)
vb
Public Sub ApplyTreeLayout(
    direction As Direction,
    items As IEnumerable(Of DiagramItem) = Nothing
)

Parameters

NameTypeDescription
directionDirection

A Direction enumeration value.

|

Optional Parameters

NameTypeDefaultDescription
itemsIEnumerable<DiagramItem>null

A collection of items to which to apply the algorithm.

|

Remarks

The items collection should include connectors.

To learn more, see Automatic Layout.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ApplyTreeLayout(Direction, IEnumerable<DiagramItem>) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-create-a-diagramshape-descendant-and-serialize-its-properties-t361265/CS/XtraDiagram.CustomShapeProperties/Form1.cs#L73

csharp
}
    diagramControl1.ApplyTreeLayout(Direction.Right);
}

how-to-create-a-diagramshape-descendant-and-serialize-its-properties-t361265/VB/XtraDiagram.CustomShapeProperties/Form1.vb#L69

vb
Next dataObject
    diagramControl1.ApplyTreeLayout(Direction.Right)
End Sub

See Also

DiagramControl Class

DiagramControl Members

DevExpress.XtraDiagram Namespace