Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  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]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
    Overview
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
     Text Formatting
     Import and Export
     Mail Merge
     Restrictions and Protection
     Line Numbering
     Table of Contents
     Check Spelling
     AutoCorrect
     Printing
     Syntax Highlighting
     Traversing the Document
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Table of Contents

This topic describes how to manually create a table of contents - from classic tables to tables of equations, and covers the following areas.

Expanded Create a Table of Contents

  1. Specify items that should be included into the TOC. To do that, mark paragraphs that correspond to the desired headings using one of the following approaches.
    • Outline level

      Specify a paragraph outline level by the Paragraph.OutlineLevel property. With the outline level applied, the paragraph content formatting remains the same. The maximum outline level is 9.

    • Heading style

      Create a new heading style or retrieve the existing one and apply it to the target paragraph using the ParagraphProperties.Style property. The collection of styles is accessible through the Document.ParagraphStyles property.

    • TC field

      The use of TC field allows you to show alternative titles in the table of contents. If your document needs two or more TOCs showing different entries, you can mark entries for a particular TOC using TC fields with an identifier (e.g., "{TC Finish \f bvz}”), which is specific for each TOC. To specify the outline level, use the \l field switch. To specify the outline level, use the \l field switch.

  2. Insert the TOC field with the corresponding switch and call the FieldCollection.Update method. Depending on the approach used to mark the TOC entry, the following switches can be used.

    • none - if entries are marked using heading styles
    • \u - if entries are marked by specifying the outline level
    • \f identifier - if the TC field is used
    Tip

    To insert all TOC entries as hyperlinks, use the \h switch. You can use any other TOC field switches to modify any kind of TOC to suite your needs.

Expanded Create a Table of Figures, Table of Tables or Table of Equations

  1. To include an element to the table, insert the element caption using the SubDocument.AppendText method and mark it with the SEQ field.

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T437901.

  2. Insert the TOC field with the \c switch and call the FieldCollection.Update method. The TOC will be created automatically.

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T437901.

The table of figures will appear in the following way.

Expanded Table of Contents in the Command UI

End-users can create and update a table of contents, figures or captions using the corresponding commands of the References Ribbon tab. To see how to provide an application with the Ribbon Command UI, refer to the How to: Create a Simple Word Processor with a Ribbon UI article.

To include the heading into the TOC, end-users should do the following.

  • Select the target text.
  • On the References ribbon tab, in the Table of Contents group, click Add Text.
  • In the invoked list, select the required level.
As a result, the corresponding heading style (Heading 1, Heading 2, etc.) is automatically applied to the selected text and added to the list of available styles.

Note

The Table of Contents group allows end-users to operate the table of contents built from heading styles only. To create a TOC from outline levels or TC fields, end-users should insert the TOC field with the corresponding switch manually.

The Reference ribbon tab allows end-users to insert captions to the document tables, figures or equations. To that, in the Captions group, click Insert Captions and select the corresponding item.

Expanded See Also

How would you rate this topic?​​​​​​​