Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListView.CheckBoxFieldName Property

Gets or sets the name of a field in a data source to which check boxes embedded into nodes are bound.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public string CheckBoxFieldName { get; set; }

#Property Value

Type Description
String

A String value that specifies the field in a data source.

#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:

    • Specify the TreeListView.CheckBoxFieldName property to bind check boxes to a Boolean field in the grid’s data source.
    • Check nodes in code.

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; }
}

Note

A field in a data source to which check boxes are bound should be of the Boolean or Nullable<Boolean> data type.

Note

Starting from v18.2, the CheckBoxFieldName property supports complex paths to nested properties (e.g., “Order.IsProcessed”).

See Also