corelibraries-devexpress-dot-mvvm-dot-celleditordata-35775754.md
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
public bool ReadOnly { get; set; }
Public Property [ReadOnly] As Boolean
| Type | Description |
|---|---|
| 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
args.CellEditors[0].Value = Employees.Count + 1;
args.CellEditors[4].ReadOnly = true;
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
args.CellEditors(0).Value = Employees.Count + 1
args.CellEditors(4).ReadOnly = True
Else
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