Back to Devexpress

Sub-Document

aspnet-117415-components-rich-text-editor-document-document-model-sub-document.md

latest4.4 KB
Original Source

Sub-Document

  • Aug 22, 2025
  • 3 minutes to read

Overview

The document’s entire content is divided into individual parts - sub-documents. A list of all sub-documents is stored within the Document Model. A sub-document to which the cursor position (or intervals of the current selection) belongs is the active sub-document. The available client-side API commands work with the active sub-document.

Sub-Document Types

The following sub-document types are available.

  • Main Sub-Document

  • Header or Footer

  • Text box

Structural Elements

A sub-document provides access to the current customization information of its main structural elements listed below. These elements are parts of the sub-document’s Text Buffer.

Client API

To access sub-documents on the client, use the following properties in the notation described below:

clientRichEditName.document.member_name

Member NameLinkDescription
subDocumentsRichEditDocument.subDocumentsReturns the document’s sub-documents.
mainSubDocumentRichEditDocument.mainSubDocumentReturns the main sub-document.
activeSubDocumentRichEditDocument.activeSubDocumentReturns the active sub-document.
getSubDocumentById(sub-document_id)RichEditDocument.getSubDocumentByIdReturns the sub-document with the specified identifier.

Sub-documents are implemented as SubDocument objects. They expose the following API resources, which can be used in the notation given below:

clientRichEditName.document.activeSubDocument.propertyName

Member NameLinkDescription
typeSubDocument.typeGets the sub-document type.
idSubDocument.idGets the sub-document identifier.
textSubDocument.textGets the document’s text.
lengthSubDocument.lengthGets the length of the sub-document.
paragraphsInfoSubDocument.paragraphsInfoReturns information about paragraphs in the sub-document.
tablesInfoSubDocument.tablesInfoReturns information about tables in the sub-document.
bookmarksInfoSubDocument.bookmarksInfoReturns information about bookmarks in the sub-document.
inlinePicturesInfoSubDocument.inlinePicturesInfoReturns information about in-line pictures in the sub-document.
fieldsInfoSubDocument.fieldsInfoReturns information about fields in the sub-document.
floatingPicturesInfoSubDocument.floatingPicturesInfoReturns information about floating pictures in the sub-document.
floatingTextBoxesInfoSubDocument.floatingTextBoxesInfoReturns information about floating text boxes in the sub-document.
findFieldsSubDocument.findFieldsReturns an array of fields that match the search conditions.
findTablesSubDocument.findTablesReturns an array of tables that match the search conditions.

You also can use the ASPxClientRichEdit.ActiveSubDocumentChanged method that fires when an active sub-document is substituted with another one.