Back to Devexpress

Field.Locked Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-field-6a449a36.md

latest3.3 KB
Original Source

Field.Locked Property

Gets or sets whether the field is locked.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
bool Locked { get; set; }
vb
Property Locked As Boolean

Property Value

TypeDescription
Boolean

true , to lock the field; otherwise, false.

|

Remarks

If the field’s Locked property is true , this field is not updated. You can set the FieldOptions.UpdateLockedFields option to UpdateLockedFields.Always to update locked fields.

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

how-to-use-docvariable-fields/CS/DocumentVariablesExample/Form1.cs#L29

csharp
#region #lockfields
richEditControl1.Document.Fields[0].Locked = true;
richEditControl2.Options.Fields.UpdateLockedFields = UpdateLockedFields.Never;

word-document-api-use-docvariable-fields/CS/Program.cs#L22

csharp
//Lock the first field to prevent updates
document.Fields[0].Locked = true;

how-to-use-docvariable-fields/VB/DocumentVariablesExample/Form1.vb#L29

vb
#Region "#lockfields"
            richEditControl1.Document.Fields(0).Locked = True
            richEditControl2.Options.Fields.UpdateLockedFields = UpdateLockedFields.Never

word-document-api-use-docvariable-fields/VB/Program.vb#L16

vb
' Lock the first field to prevent updates
document.Fields(0).Locked = True

See Also

Field Interface

Field Members

DevExpress.XtraRichEdit.API.Native Namespace