windowsforms-devexpress-dot-xtradiagram-dot-diagramitem-92dc4815.md
Returns the current item’s parent item.
Namespace : DevExpress.XtraDiagram
Assembly : DevExpress.XtraDiagram.v25.2.dll
NuGet Package : DevExpress.Win.Diagram
[Browsable(false)]
public DiagramItem ParentItem { get; }
<Browsable(False)>
Public ReadOnly Property ParentItem As DiagramItem
| Type | Description |
|---|---|
| DiagramItem |
A DiagramItem object that represents the current item’s parent item.
|
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
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
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
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
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