Skip to main content

CopyPasteOptions.MaintainDocumentSectionSettings Property

Gets or sets whether to retain section settings of a blank document after appending RTF content.

Namespace: DevExpress.XtraRichEdit

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

[DefaultValue(false)]
public bool MaintainDocumentSectionSettings { get; set; }

Property Value

Type Default Description
Boolean false

true, to keep section settings of a target blank document; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to MaintainDocumentSectionSettings
RichEditControlOptionsBase
.CopyPaste .MaintainDocumentSectionSettings

Remarks

The MaintainDocumentSectionSettings option is helpful in following situations.

First, create an empty document as described below. You can either:

  • Create a blank document with specific section settings by loading a document from a template.
  • Create a new document programmatically (using the CreateNewDocument method) and specify section settings.
  • Delete document content in code or by using UI commands.

Next, append the content of another document to the blank document. To accomplish this, you can copy and paste the entire document (CTRL-A - CTRL-C - CTRL-V) or use the SubDocument.AppendDocumentContent or SubDocument.AppendRtfText methods.

By default, when you copy document content to an empty document, the settings of the empty document are ignored. To prevent this, set the MaintainDocumentSectionSettings to true. Then, the copied content takes the settings of the empty document to which it is copied.

See Also