Back to Devexpress

TreeListView.AllowRecursiveNodeChecking Property

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

latest3.8 KB
Original Source

TreeListView.AllowRecursiveNodeChecking Property

Gets or sets whether recursive node selection is enabled. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public bool AllowRecursiveNodeChecking { get; set; }
vb
Public Property AllowRecursiveNodeChecking As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true, to enable recursive selection; otherwise, false.

|

Remarks

Set the AllowRecursiveNodeChecking property to true to enable recursive node checking:

  • When you check/uncheck a parent node, its children become checked/unchecked.
  • When you check/uncheck all child nodes, its parent becomes checked/unchecked.
  • When you check/uncheck a child node, but not all child nodes are checked/unchecked, its parent goes to the indeterminate check state.

xaml
<dxg:GridControl Name="gridControl">
    <dxg:GridControl.Columns>
        <dxg:GridColumn FieldName="Name"/>
        <dxg:GridColumn FieldName="Department"/>
        <dxg:GridColumn FieldName="Position"/>
    </dxg:GridControl.Columns>
    <dxg:GridControl.View>
        <dxg:TreeListView KeyFieldName="ID" ParentFieldName="ParentID" AutoExpandAllNodes="True"
                          ShowCheckboxes="True" CheckBoxFieldName="OnVacation" AllowRecursiveNodeChecking="True" />
    </dxg:GridControl.View>
</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 OnVacation { 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 OnVacation As Boolean
End Class

The TreeListNode.IsChecked property returns the following values:

  • true - if all child nodes are checked
  • false - if none of child nodes are checked
  • null - if a node contains both checked and unchecked children.

Note

If the AllowRecursiveNodeChecking is true , when you use the TreeListView.CheckBoxFieldName property to update a field in a data source, this field should be of the Nullable<Boolean> data type.

Note

Even if the TreeListView.AllowRecursiveNodeChecking is true , for the first time the TreeListView sets values of check boxes in accordance with a data source values.

See Also

Check Nodes

AllowIndeterminateCheckState

TreeListView Class

TreeListView Members

DevExpress.Xpf.Grid Namespace