Back to Devexpress

TreeListView.ExpandStateFieldName Property

wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-a187ad93.md

latest2.3 KB
Original Source

TreeListView.ExpandStateFieldName Property

Gets or sets the name of the data field within the items source that determines which nodes are expanded.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public string ExpandStateFieldName { get; set; }
vb
Public Property ExpandStateFieldName As String

Property Value

TypeDescription
String

A name of the data field that specifies which nodes are expanded.

|

Remarks

xaml
<dxg:GridControl ItemsSource="{Binding Employees}">
    <dxg:GridControl.View>
        <dxg:TreeListView KeyFieldName="ID" 
                          ParentFieldName="ParentID" 
                          ExpandStateFieldName="Expanded"/>
    </dxg:GridControl.View>
    <!-- columns -->
</dxg:GridControl>
csharp
public class Employee {
    public int ID { get; set; }
    public int ParentID { get; set; }
    public string Name { get; set; }
    public string Position { get; set; }
    public string Department { get; set; }
    public bool Expanded { get; set; }
}
vb
Public Class Employee
    Public Property ID As Integer
    Public Property ParentID As Integer
    Public Property Name As String
    Public Property Position As String
    Public Property Department As String
    Public Property Expanded As Boolean
End Class

See Also

Expand and Collapse Nodes

TreeListView Class

TreeListView Members

DevExpress.Xpf.Grid Namespace