Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DocumentCustomProperties Interface

Contains all the custom document properties for the document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#Declaration

public interface DocumentCustomProperties

The following members return DocumentCustomProperties objects:

#Remarks

Use the Document.CustomProperties property to obtain the DocumentCustomProperties object.

To get an individual document property, access it by name (use the DocumentCustomProperties.Item property).

The code below demonstrates how to create simple and linked custom properties. A linked custom property updates its value from the bookmark assigned to the property when the document is saved.

To display a property in a document, insert a DOCPROPERTY field.

#Example

View Example

server.CreateNewDocument();
Document document = server.Document;
document.BeginUpdate();
document.Fields.Create(document.AppendText("\nMyNumericProperty: ").End, "DOCVARIABLE CustomProperty MyNumericProperty");
document.Fields.Create(document.AppendText("\nMyStringProperty: ").End, "DOCVARIABLE CustomProperty MyStringProperty");
document.Fields.Create(document.AppendText("\nMyBooleanProperty: ").End, "DOCVARIABLE CustomProperty MyBooleanProperty");
document.EndUpdate();

document.CustomProperties["MyNumericProperty"]= 123.45;
document.CustomProperties["MyStringProperty"]="The Final Answer";
document.CustomProperties["MyBooleanProperty"]=true;

server.CalculateDocumentVariable += DocumentPropertyDisplayHelper.OnCalculateDocumentVariable;
document.Fields.Update();
See Also