Skip to main content

GridColumn.ReadOnly Property

Returns the OptionsColumn.ReadOnly property value.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

[Browsable(false)]
public bool ReadOnly { get; }

Property Value

Type Description
Boolean

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

Remarks

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