Back to Devexpress

Table of Contents

windowsforms-9561-controls-and-libraries-rich-text-editor-page-layout-table-of-contents.md

latest3.9 KB
Original Source

Table of Contents

  • Oct 29, 2020
  • 5 minutes to read

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

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.

  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.

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.

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

The table of figures will appear in the following way.

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 the RichEditControl 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.

The Table of Contents Dialog allows end-users to change the target table of contents’ appearance by changing the number of displaying levels or by hiding the entries’ page numbers.

See Also

Field Codes

Table of Contents Dialog

How to: Create a Table of Contents in Code