Skip to main content
A newer version of this page is available. .
All docs

BaseColumn.IsEnabledBinding Property

Gets or sets the binding that determines a cell’s enabled state.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.2.Core.dll


public BindingBase IsEnabledBinding { get; set; }

Property Value

Type Default Description


The binding that associates the enabled state of cells with a property in a data source.


The code sample below disables cells in the Start Date and Due Date columns if the Progress value equals 100%:

View Example: Read-only and Enabled State Binding

<dxg:TreeListControl x:Name="treeList"
                     ItemsSource="{Binding Path=EditableDataSource, Source={StaticResource employeeTasks}}">
        <dxg:TreeListColumn FieldName="Name" Header="Task"/>
        <dxg:TreeListColumn FieldName="Employee" Header="Assignee"/>
        <dxg:TreeListColumn FieldName="Status" Header="Progress"/>            

        <dxg:TreeListColumn FieldName="StartDate" 
                            IsEnabledBinding="{Binding IsCompleted, Converter={dx:BoolInverseConverter}}"/>
        <dxg:TreeListColumn FieldName="DueDate" 
                            IsEnabledBinding="{Binding IsCompleted, Converter={dx:BoolInverseConverter}}"/>

        <dxg:TreeListView x:Name="view" KeyFieldName="ID" ParentFieldName="ParentID"/>
public class EmployeeTask: INotifyPropertyChanged {
    public int ID { get; set; }
    public int ParentID { get; set; }
    public string Name { get; set; }
    public string Employee { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime DueDate { get; set; }

    public bool IsCompleted { get { return Status == 100; } }
    int _status;
    public int Status { 
        get { return _status; } 
        set { _status = value; OnPropertyChanged(); OnPropertyChanged("IsCompleted"); } 

    // ...    

Customize Appearance Settings of Disabled Cells

To change the appearance settings of read-only cells, use the ColumnBase.CellStyle property with a trigger. Use the LightweightCellEditor as the style’s target type.

    <Style TargetType="dxg:LightweightCellEditor">
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="DarkGray" />

Use the LightweightCellEditor.EditorOpacity property to change the opacity of the cell editor displayed in a disabled cell.


For more information, refer to Disable Editing.

See Also