Back to Devexpress

TreeListView.IsCheckBoxEnabledFieldName Property

wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-2a0c77f3.md

latest3.0 KB
Original Source

TreeListView.IsCheckBoxEnabledFieldName Property

Gets or sets the name of a data source’s field whose values determine whether a node’s check box is enabled.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

Property Value

TypeDescription
String

A data source’s field name that defines whether a node’s check box is enabled.

|

Remarks

Specify the IsCheckBoxEnabledFieldName / IsCheckBoxEnabledBinding option to bind the enabled state of check boxes to a property.

Note

The IsCheckBoxEnabledBinding property takes precedence over the IsCheckBoxEnabledFieldName property.

Example

The code sample below shows how to bind the enabled state of check boxes to the Enabled field:

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" IsCheckBoxEnabledFieldName="Enabled" />
    </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; }
    public bool Enabled { 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
    Public Property Enabled As Boolean
End Class

See Also

TreeListView Class

TreeListView Members

DevExpress.Xpf.Grid Namespace