[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Collapse]RichEditControl Document
    [Expand]Document Structure
    [Collapse]Document Elements
      Positions and Ranges
      Paragraphs
      Sections
      Lists
      Inline Pictures
      Shapes
      Text Boxes
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Comments
      Checkboxes
      Document Properties
     Measure Units
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Hyphenation
    Spell Checking
    AutoCorrect Feature
    Track Changes
    Mail Merge
    Restrictions and Protection
   [Expand]Visual Elements
    Services
    Events
    Commands
    Keyboard Shortcuts
    HTML Tag Support
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Sections

The RichEditControl provides the following ways to manage document sections:

Expanded Sections in the User Interface

You can insert section and page breaks and set the page layout options using the Page Layout ribbon tab. Refer to the How to: Create the RichEditControl with a Ribbon UI topic for information on how to add a Ribbon UI to the RichEditControl.

Use the RichEditBehaviorOptions.PageBreakInsertMode property to specify whether a page break is inserted next to the specified position or in the new line.

The RichEditControl ships with the Page Setup Dialog. This dialog allows end-users to define a page's formatting options of a whole document or a particular section.

Tip

Set the DocumentCapabilitiesOptions.Sections property to Hidden or Disabled to restrict end-users from managing document sections.

Expanded Divide a Document into Sections

The Document.Sections property provides access to the document's section collection. Use the following methods to insert a section in code:

Specify the Section.StartType property to define the section break's type. The RichEditControl supports the following section breaks:

  • Next Page - starts the new section on the following page.
  • Continuous - starts the new section on the same page.
  • Even Page - starts a new section on the next even-numbered page.
  • Odd Page - starts a new section on the next odd-numbered page.
  • Column - starts a new section on the next column on the page.

Expanded Define Page Formatting Options

Each section has page formatting options. You can use the SectionPage class properties to specify the page's paper type, orientation, margins, etc. Use the Section.Page property to access the SectionPage object .

The code sample below specifies the first section's page formatting options: sets the portrait orientation and the A3 Extra paper size.

Expanded Line Numbering

Set the SectionLineNumbering.CountBy property to a non-zero value to enable line numbering. Refer to the Line Numbering topic for more information.

Line numbers in the Print Layout View are displayed automatically. Use the RichEditView.AllowDisplayLineNumbers property to show line numbers in Simple and Draft Views.

Expanded Columns

Call the SectionColumns.CreateUniformColumns method to create a multi-column layout. Refer to the How to: Create a Three-Column Layout with Uniform Columns topic for more information.

Expanded Page Numbering

Each document section has its own page numbering settings (page number format, initial number, etc.). Use the Section.PageNumbering property to access the SectionPageNumbering class properties and specify section's page numbering options. You should reset the numbering options by setting the SectionPageNumbering.ContinueNumbering property to false before you apply new options. The PAGE field represents a document's page number. To apply new settings to existing page numbers, call the FieldCollection.Update method to update all fields.

The code sample below specifies the initial number and the NumberingFormat.CardinalText numbering format.

Expanded Headers and Footers

Headers and footers in the document belong to a particular section. You can use the Section.BeginUpdateHeader - Section.EndUpdateHeader and the Section.BeginUpdateFooter - Section.EndUpdateHeader method pairs to edit header or footer content. Refer to the Headers and Footers topic for more information.

Expanded See Also

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