Back to Devexpress

DiagramNodeMappingInfo.ParentKey Property

aspnet-devexpress-dot-web-dot-aspxdiagram-dot-diagramnodemappinginfo.md

latest2.3 KB
Original Source

DiagramNodeMappingInfo.ParentKey Property

Specifies the name of a data source field that provides a parent node key for a node.

Namespace : DevExpress.Web.ASPxDiagram

Assembly : DevExpress.Web.ASPxDiagram.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string ParentKey { get; set; }
vb
<DefaultValue("")>
Public Property ParentKey As String

Property Value

TypeDefaultDescription
StringString.Empty

The field name.

|

Remarks

Specify the ParentKey property if your diagram has tree-like structure, and nodes are connected by Id - Parent Id relation. For more information, review the following topic: Self-Referenced Data Structure

Tip

Use the ParentKey property to change the parent of a node after it is bound to a data source (in the NodeDataBound event).

Run Demo: Data Binding

aspx
<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px" NodeDataSourceID="DepartmentDemoDataSource" >
    <Mappings>
        <Node Key="ID" Text="DepartmentName" ParentKey="ParentID" />
    </Mappings>
</dx:ASPxDiagram>

]

See Also

NodeDataBound

Self-Referenced Data Structure

DiagramNodeMappingInfo Class

DiagramNodeMappingInfo Members

DevExpress.Web.ASPxDiagram Namespace