wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-dee0b6f3.md
Gets or sets the name of the service field in a data source that identifies the parent node. This is a dependency property.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public string ParentFieldName { get; set; }
Public Property ParentFieldName As String
| Type | Description |
|---|---|
| String |
The name of the field that identifies the parent node.
|
If you want to implement the Self-Referential data structure, you should include two service fields in your data source:
Key FieldContains unique values. Assign this field to the KeyFieldName property.Parent FieldIdentifies the parent node. Assign this field to the ParentFieldName property.
Columns bound to these fields are called service columns.
Both KeyFieldName and ParentFieldName properties support nested fields (for example, Account.Id).
The following code snippets (auto-collected from DevExpress Examples) contain references to the ParentFieldName 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.
wpf-tree-list-calculate-custom-node-summaries/CS/CustomNodeSummaries_CodeBehind/MainWindow.xaml#L14
<dxg:TreeListView AutoExpandAllNodes="True" AutoWidth="True"
KeyFieldName="ID" ParentFieldName="ParentID"
ShowNodeFooters="True"
wpf-lookupedit-display-treelist-as-popup-content/CS/CustomTreeViewComboBox/MainWindow.xaml#L20
KeyFieldName="ID"
ParentFieldName="ParentID"
TreeDerivationMode="Selfreference"/>
how-to-customize-drop-marker-t568780/CS/MainWindow.xaml#L23
<dxg:GridControl.View>
<dxg:TreeListView KeyFieldName="ID" ParentFieldName="ParentID"
AutoExpandAllNodes="True" AllowDragDrop="True">
how-to-implement-drag-and-drop-between-gridcontrols-t566656/CS/MainWindow.xaml#L15
<dxg:TreeListView KeyFieldName="ID"
ParentFieldName="ParentID"
AutoExpandAllNodes="True"
<dxg:TreeListView x:Name="view" AutoWidth="True"
KeyFieldName="ID" ParentFieldName="ParentID"/>
</dxg:GridControl.View>
See Also