Back to Devexpress

Sections

aspnet-117600-components-rich-text-editor-document-document-model-sections.md

latest4.7 KB
Original Source

Sections

  • Aug 07, 2023
  • 3 minutes to read

Overview

Within a document, there is often a need for groupings of content on a basis larger than a paragraph (for example, ensuring that a specific set of paragraphs and tables are printed in a landscape view, while ensuring that the remainder of the document is printed in a portrait view). In order to group this content, a document can be divided into multiple sections, each of which defines a region of content in the document and allows the application of a set of section-level properties.

Definition

A document contains at least one section. A section is a sequence of contiguous paragraphs within a sub-document’s text buffer. To delimit document sections, the end of a section is marked by a specific section break (or by the final paragraph’s end mark at the end of the document). The boundaries of sections mark locations where the layout rules for a document (the page size and orientation, the size of columns, text of headers and footers, the availability and display of page numbers, etc.) are changed.

A section is a logical unit that contains settings specific for its different elements and that defines to which text buffer interval these settings should be applied. Programmatically, a section is implemented as the Section client object. A list of section objects in the document can be accessed through the sectionsInfo client property (RichEditDocument.sectionsInfo) in the following notation:

clientRichEditName.document.sectionsInfo

A section defines the following settings.

Client API

The following client commands are available for manipulating sections and their settings. Call the commands in the notation given below:

clientRichEditName.commands.commandName.execute(parameter_if_any)

Command NameLinkDescription
Page
changePageMarginsRichEditCommands.changePageMarginsGets a command to apply page margins settings to sections located within a selected range.
changePageOrientationRichEditCommands.changePageOrientationGets a command to apply page orientation settings to sections located within a selected range.
changePageSizeRichEditCommands.changePageSizeGets a command to apply page size settings to sections located within a selected range.
Columns
changeSectionColumnsRichEditCommands.changeSectionColumnsGets a command to apply column layout settings to a section.
changeSectionEqualColumnCountRichEditCommands.changeSectionEqualColumnCountGets a command to change the number of columns having the same width in a section.
Header/Footer
setDifferentFirstPageHeaderFooterRichEditCommands.setDifferentFirstPageHeaderFooterGets a command to enable (or disable if it is enabled) a different page header and footer for the first page of the current section.
Dialogs
openPageMarginsDialogRichEditCommands.openPageMarginsDialogGets a command to invoke the Margins tab of the Page Setup dialog window.
openPagePaperSizeDialogRichEditCommands.openPagePaperSizeDialogGets a command to invoke the Paper tab of the Page Setup dialog window.
openSectionColumnsDialogRichEditCommands.openSectionColumnsDialogGets a command to invoke the Columns dialog window.
setPageSizeDialogRichEditCommands.setPageSizeDialogGets a command to invoke the Page Setup dialog.