[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Getting Started
     ASPxRichEdit Control
     [Collapse]Document Model
       Text Content (Text Buffer)
       Inline Pictures
       Hyperlinks and Bookmarks
       Headers and Footers
       Document Fields
       Floating Objects
       Document Protection
      Document Layout
     Supported Document Formats and Printing
     Import and Export
     Formatting Characters
     Formatting Paragraphs
     Mail Merge
     Simple View
     Table of Contents
     Spell Checking
    [Expand]Client API
    [Expand]Built-in Dialogs
     HTML Tag Interpretation
     Keyboard Shortcuts
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


Expanded 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.

Expanded Sub-Document Types

The following sub-document types are available.

  • Main Sub-Document
    In a document, at least one sub-document always exists, it is the main sub-document. There is always a single instance of the main sub-document, and it is active by default. The main sub-document delivers the basic document functionality that is common for the header, footer and the main document body. The length of the main sub-document's text buffer affects the number of pages (Page layout elements) in the RichEdit Document Layout.

  • Header or Footer
    A header or footer is represented by an individual sub-document. The header (or footer) can be different for odd pages, even pages or the first page. So, there usually are several sub-document instances of the header (or footer) type: one sub-document for each header (or footer) with unique settings. As a rule, one sub-document of the header (or footer) type is bound to several Page Area layout elements on several Pages. (See the Sections topic for more details.)

  • Text box
    Each text box is represented by an individual sub-document. (See the Floating Objects topic for more details.)

Expanded 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.

Expanded Client API

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

Member Name Link Description
subDocuments RichEditDocument.subDocuments Provides access to the document's sub-documents.
mainSubDocument RichEditDocument.mainSubDocument Provides access to the document's main sub-document.
activeSubDocument RichEditDocument.activeSubDocument Provides the information about the active sub-document.
getSubDocumentById(sub-document_id) RichEditDocument.getSubDocumentById Returns 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:

Member Name Link Description
type SubDocument.type Gets a value specifying the sub-document type.
id SubDocument.id Gets the sub-document identifier.
text SubDocument.text Gets the document's textual representation.
length SubDocument.length Gets the character length of the document.
paragraphsInfo SubDocument.paragraphsInfo Provides information about paragraphs contained in the document.
tablesInfo SubDocument.tablesInfo Provides information about tables contained in the document.
bookmarksInfo SubDocument.bookmarksInfo Provides information about document bookmarks.
inlinePicturesInfo SubDocument.inlinePicturesInfo Provides access to an array of objects containing in-line picture settings.
fieldsInfo SubDocument.fieldsInfo Provides information about fields in the current document.
floatingPicturesInfo SubDocument.floatingPicturesInfo Provides information about floating pictures in the sub-document.
floatingTextBoxesInfo SubDocument.floatingTextBoxesInfo Provides information about floating text boxes contained within the sub-document if it is the main sub-document or header/footer.
findFields SubDocument.findFields Returns all fields contained in the specified interval.
findTables SubDocument.findTables Returns a table if its interval includes the specified position.

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

Is this topic helpful?​​​​​​​