Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridColumn.ReadOnly Property

Returns the OptionsColumn.ReadOnly property value.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v24.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