windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-d8c4df26.md
Returns the OptionsColumn.ReadOnly property value.
Namespace : DevExpress.XtraGrid.Columns
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[Browsable(false)]
public bool ReadOnly { get; }
<Browsable(False)>
Public ReadOnly Property [ReadOnly] As Boolean
| Type | Description |
|---|---|
| Boolean |
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;
Imports DevExpress.XtraGrid.Columns
'...
For Each col As GridColumn In gridView1.Columns
If (col.ReadOnly) Then
col.AppearanceCell.BackColor = Color.Gray
End If
Next
See Also