Back to Devexpress

ColumnViewOptionsBehavior.Editable Property

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

latest8.5 KB
Original Source

ColumnViewOptionsBehavior.Editable Property

Gets or sets whether end-users are allowed to edit data (using in-place cell editors and Edit Forms).

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool Editable { get; set; }
vb
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property Editable As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if end-users are allowed to edit data; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Editable
ColumnView

.OptionsBehavior .Editable

|

Remarks

Set the Editable property to false to disable data editing using in-place cell editors and Edit Forms.

If the Editable option is true , and regular data editing mode (in grid cells) is active (see GridOptionsBehavior.EditingMode), you can use the following members to disable cell editors in certain columns:

If data editing via an Edit Form is enabled, the OptionsColumn.AllowEdit property and ColumnView.ShowingEditor event do not let you disable column editors. To accomplish this task, use the column’s OptionsColumn.ReadOnly property. To forbid display of an Edit Form according to your logic, you can handle the GridView.EditFormShowing event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Editable 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-mvvm-expenses-app/CS/MVVMExpenses/Views/Account/AccountsView.cs#L21

csharp
InitBindings();
gridView1.OptionsBehavior.Editable = false;
gridView1.OptionsSelection.MultiSelect = true;

winforms-grid-double-click-row-cell/CS/DoubleClickCell/Form1.cs#L40

csharp
// Requires a single event handler. Works always.
gridView1.OptionsBehavior.Editable = false;
gridView1.DoubleClick += gridView1_DoubleClick;

XPO_how-to-prevent-xpo-from-making-any-changes-to-a-legacy-database-e849/CS/Form1.cs#L19

csharp
foreach(ColumnView view in gridControl1.ViewCollection)
    view.OptionsBehavior.Editable = false;

winforms-grid-select-rows-using-mouse-without-ctrl/CS/MultiSelectionHelper.cs#L26

csharp
{
    _GridView.OptionsBehavior.Editable = false;
    _GridView.OptionsSelection.MultiSelect = true;

winforms-mvvm-drag-drop-rows-between-grids/CS/DragDropHelper/DragAndDropHelper.cs#L42

csharp
gridControl.DragDrop += new System.Windows.Forms.DragEventHandler(grid_DragDrop);
gridView.OptionsBehavior.Editable = false;
gridView.MouseMove += new System.Windows.Forms.MouseEventHandler(view_MouseMove);

winforms-mvvm-expenses-app/VB/MVVMExpenses/Views/Account/AccountsView.vb#L24

vb
End If
gridView1.OptionsBehavior.Editable = False
gridView1.OptionsSelection.MultiSelect = True

winforms-grid-double-click-row-cell/VB/DoubleClickCell/Form1.vb#L40

vb
' Requires a single event handler. Works always.
gridView1.OptionsBehavior.Editable = False
AddHandler gridView1.DoubleClick, AddressOf gridView1_DoubleClick

XPO_how-to-prevent-xpo-from-making-any-changes-to-a-legacy-database-e849/VB/Form1.vb#L21

vb
For Each view As ColumnView In gridControl1.ViewCollection
    view.OptionsBehavior.Editable = False
Next view

winforms-grid-select-rows-using-mouse-without-ctrl/VB/MultiSelectionHelper.vb#L21

vb
Private Sub InitProperties()
    _GridView.OptionsBehavior.Editable = False
    _GridView.OptionsSelection.MultiSelect = True

winforms-mvvm-drag-drop-rows-between-grids/VB/DragDropHelper/DragAndDropHelper.vb#L60

vb
AddHandler gridControl.DragDrop, New DragEventHandler(AddressOf grid_DragDrop)
gridView.OptionsBehavior.Editable = False
AddHandler gridView.MouseMove, New MouseEventHandler(AddressOf view_MouseMove)

See Also

AllowEdit

OptionsColumn.ReadOnly

ShowingEditor

ColumnViewOptionsBehavior.ReadOnly

CustomRowCellEditForEditing

EditFormShowing

ColumnViewOptionsBehavior Class

ColumnViewOptionsBehavior Members

DevExpress.XtraGrid.Views.Base Namespace