Back to Devexpress

CellEditorData.ReadOnly Property

corelibraries-devexpress-dot-mvvm-dot-celleditordata-35775754.md

latest3.3 KB
Original Source

CellEditorData.ReadOnly Property

Gets or sets whether a user can edit data in the editor.

Namespace : DevExpress.Mvvm

Assembly : DevExpress.Mvvm.v25.2.dll

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

Declaration

csharp
public bool ReadOnly { get; set; }
vb
Public Property [ReadOnly] As Boolean

Property Value

TypeDescription
Boolean

true if a user cannot edit data in the editor; otherwise, false.

|

The following code snippets (auto-collected from DevExpress Examples) contain references 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.

wpf-data-grid-specify-edit-form-settings/CS/DefineEditFormSettings_MVVM/MainViewModel.cs#L27

csharp
args.CellEditors[0].Value = Employees.Count + 1;
args.CellEditors[4].ReadOnly = true;

wpf-data-grid-edit-form-related-cells/CS/SynchronizeEditValuesInEditForm_CodeBehind/MainWindow.xaml.cs#L42

csharp
var priceData = editFormArgs.CellEditors.FirstOrDefault(x => x.FieldName == nameof(DataItem.Price));
priceData.ReadOnly = !bool.Parse(e.Cell.Value.ToString());
return;

wpf-data-grid-specify-edit-form-settings/VB/DefineEditFormSettings_MVVM/MainViewModel.vb#L84

vb
args.CellEditors(0).Value = Employees.Count + 1
    args.CellEditors(4).ReadOnly = True
Else

wpf-data-grid-edit-form-related-cells/VB/SynchronizeEditValuesInEditForm_CodeBehind/MainWindow.xaml.vb#L50

vb
Dim priceData = editFormArgs.CellEditors.FirstOrDefault(Function(x) Equals(x.FieldName, NameOf(DataItem.Price)))
priceData.[ReadOnly] = Not Boolean.Parse(e.Cell.Value.ToString())
Return

See Also

CellEditorData Class

CellEditorData Members

DevExpress.Mvvm Namespace