Skip to main content

TreeListView.ShowCheckboxes Property

Gets or sets whether to display node check boxes.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.1.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public bool ShowCheckboxes { get; set; }

Property Value

Type Description
Boolean

true to display node check boxes; otherwise, false.

Remarks

You can embed check boxes into nodes to allow an end user to check/uncheck individual nodes.

Embed Check Boxes into Nodes

  1. Set the TreeListView.ShowCheckboxes property to true to display check boxes embedded into nodes.

  2. Set values of check boxes. Do one of the following:

The code sample below shows how to display check boxes and bind them to the OnVacation field:

<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"
            CheckBoxFieldName="OnVacation" ShowCheckboxes="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; }
}
See Also