wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-0dc6d974.md
Gets or sets whether an end user can set the node’s check boxes to three states (checked, unchecked and indeterminate). This is a dependency property.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public bool AllowIndeterminateCheckState { get; set; }
Public Property AllowIndeterminateCheckState As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true, to allow selecting the indeterminate state of a check box; otherwise, false.
|
Set the AllowIndeterminateCheckState property to true to allow an end user to set the node’s check boxes to three states (checked, unchecked, and indeterminate):
<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" AllowIndeterminateCheckState="True" />
</dxg:GridControl.View>
</dxg:GridControl>
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; }
}
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:
Note
The AllowIndeterminateCheckState property affects only the ability of an end user to directly select the indeterminate state of a check box. This state can be set by a data source or via recursive checking regardless of the AllowIndeterminateCheckState property’s value.
Set the TreeListView.AllowRecursiveNodeChecking property to true to enable recursive node checking:
<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>
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; }
}
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
Note
If the TreeListView.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