Back to Devexpress

DiagramItem.ParentItem Property

windowsforms-devexpress-dot-xtradiagram-dot-diagramitem-92dc4815.md

latest3.9 KB
Original Source

DiagramItem.ParentItem Property

Returns the current item’s parent item.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
[Browsable(false)]
public DiagramItem ParentItem { get; }
vb
<Browsable(False)>
Public ReadOnly Property ParentItem As DiagramItem

Property Value

TypeDescription
DiagramItem

A DiagramItem object that represents the current item’s parent item.

|

Remarks

If the current item is contained in a container, the ParentItem property returns the DiagramContainer object representing this container. Otherwise, it returns the DevExpress.XtraDiagram.DiagramRoot object.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ParentItem property.

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.

winforms-diagram-proportionally-resize-shapes-within-container/CS/WindowsFormsApp4/Form1.cs#L39

csharp
private void DiagramControl1_ItemsResizing(object sender, DiagramItemsResizingEventArgs e) {
    var groups = e.Items.GroupBy(x => x.Item.ParentItem);
    foreach (var group in groups) {

winforms-diagram-create-rotatable-containers-with-shapes/CS/WindowsFormsApp4/Form1.cs#L38

csharp
private void DiagramControl1_ItemsRotating(object sender, DiagramItemsRotatingEventArgs e) {
    var groups = e.Items.GroupBy(x => x.Item.ParentItem);
    foreach (var group in groups) {

winforms-diagram-proportionally-resize-shapes-within-container/VB/WindowsFormsApp4/Form1.vb#L41

vb
Private Sub DiagramControl1_ItemsResizing(ByVal sender As Object, ByVal e As DiagramItemsResizingEventArgs)
    Dim groups = e.Items.GroupBy(Function(x) x.Item.ParentItem)
    For Each group In groups

winforms-diagram-create-rotatable-containers-with-shapes/VB/WindowsFormsApp4/Form1.vb#L42

vb
Private Sub DiagramControl1_ItemsRotating(ByVal sender As Object, ByVal e As DiagramItemsRotatingEventArgs)
    Dim groups = e.Items.GroupBy(Function(x) x.Item.ParentItem)
    For Each group In groups

See Also

DiagramItem Class

DiagramItem Members

DevExpress.XtraDiagram Namespace