Back to Devexpress

ColumnViewOptionsBehavior.ReadOnly Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnviewoptionsbehavior.md

latest3.9 KB
Original Source

ColumnViewOptionsBehavior.ReadOnly Property

Gets or sets whether the current View is read-only.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool ReadOnly { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property [ReadOnly] As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if the current View is read-only; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ReadOnly
ColumnView

.OptionsBehavior .ReadOnly

|

Remarks

In read-only mode, cell editors can be invoked. However, end-users can only select and copy an editor’s content. The ReadOnly property enables the read-only status for the current View. To set the read-only status for individual columns, use the column’s OptionsColumn.ReadOnly property.

To prevent editors from being activated, disable the ColumnViewOptionsBehavior.Editable property.

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

Note

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.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/Heatmap/HeatmapOptionsControl.cs#L102

csharp
gridView.OptionsBehavior.Editable = allowChanges;
gridView.OptionsBehavior.ReadOnly = !allowChanges;
absoluteLevelsEdit.Enabled = !(percents || allowChanges);

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/Heatmap/HeatmapOptionsControl.vb#L111

vb
gridView.OptionsBehavior.Editable = allowChanges
gridView.OptionsBehavior.ReadOnly = Not allowChanges
absoluteLevelsEdit.Enabled = Not (percents OrElse allowChanges)

See Also

ReadOnly

Editable

ColumnViewOptionsBehavior Class

ColumnViewOptionsBehavior Members

DevExpress.XtraGrid.Views.Base Namespace