TC (Table of Contents Entry) Field
The TC (Table of Contents Entry) field defines the text and page numbers for entries in a table of contents and in lists of tables, figures, and similar contents. This fields should be inserted before the text that you want to include in the contents.
In order to update the field, you need to set the FlowExtensibilityManager.NumberingFieldsProvider.
Syntax
Syntax |
---|
{ TC "Text" [Switches ] } |
Switches
Switches are a way for the code fragment to specify formatting for the result of the field. More information is available in the Syntax and Switches section of the Fields article.
Switch | Description |
---|---|
\f Type | The item types used in particular contents list. Use a unique Type identifier (typically a letter from A-Z) for each type of list. |
\l Level | The level of the TC entry. |
\n | Omits the page number for the entry. |
Inserting
Inserting this field is easily achieved through the RadFlowDocumentEditor's InsertField() method. It accepts code as argument.
Example 1 demonstrates how you can insert a TC field.
Example 1: Insert TC field
editor.InsertText("Text before ");
editor.InsertBreak(BreakType.LineBreak);
editor.InsertField("TC Item1 \f a \l 1");
editor.InsertBreak(BreakType.LineBreak);
editor.InsertText("Text after");