Skip to main content
All docs

BaseColumn.IsReadOnlyBinding Property

Gets or sets the binding that determines a cell’s read-only state.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.1.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public BindingBase IsReadOnlyBinding { get; set; }

Property Value

Type Default Description
BindingBase null

The binding that associates the read-only state of cells with a property in a data source.


The code sample below sets cells in the Progress column as read-only if a task has subtasks:

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" 
                            IsReadOnlyBinding="{Binding HasSubtasks}"/>

        <dxg:TreeListColumn FieldName="StartDate"/>
        <dxg:TreeListColumn FieldName="DueDate"/>
        <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 int Status { get; set; }        
    public bool HasSubtasks { get; }

    // ...

Customize Appearance Settings of Read-only 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="ReadOnly" Value="True">
                <Setter Property="Background" Value="LightGray" />                               


For more information, refer to Disable Editing.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IsReadOnlyBinding property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also