Skip to main content

GridColumn.ReadOnly Property

Returns the OptionsColumn.ReadOnly property value.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation


public bool ReadOnly { get; }

Property Value

Type Description

true if the OptionsColumn.ReadOnly option is enabled; otherwise, false.


Do not rely on the ReadOnly property to determine whether users can edit cell values at runtime, since there are two more related settings: the Editable behavior option on the View level, and the OptionsColumn.AllowEdit option on the Column level.

The code sample below illustrates how to paint all read-only columns with a gray background.

using DevExpress.XtraGrid.Columns;


foreach (GridColumn col in gridView1.Columns)
    if (col.ReadOnly)
        col.AppearanceCell.BackColor = Color.Gray;
See Also