New to Telerik Document ProcessingStart a free 30-day trial

Run

Updated on Jun 16, 2026

Run is an inline-level flow content element intended to contain a run of formatted text.

Inserting a Run

The code in Example 1 creates a Run element and adds it to a Paragraph.

Example 1: Create and add a run to a paragraph

C#
RadFlowDocument document = new RadFlowDocument();
Section section = document.Sections.AddSection();
Paragraph paragraph = section.Blocks.AddParagraph();

Run run0 = new Run(document);
paragraph.Inlines.Add(run0);

The parent Paragraph must belong to the same document that is passed to the constructor of the Run.

You can add a run at a specific index in the Inlines collection of a paragraph using the Insert() method. Example 2 demonstrates how to add a run at the beginning of a paragraph.

Example 2: Create and add a run at a specific index of a paragraph's Inlines collection

C#
Run run = new Run(document);
paragraph.Inlines.Insert(0, run);

You can also use the AddRun() method of the Inlines collection of a paragraph. The method creates a new Run instance, adds it to the container, and returns it:

Example 3: Create and add a run to a paragraph

C#
//Adds an empty run.
Run run1 = paragraph.Inlines.AddRun();

//Adds a run and sets the text to the text property.
Run run2 = paragraph.Inlines.AddRun("The text.");

You can also insert text in the document with the RadFlowDocumentEditor class:

Example 4: Insert a run using RadFlowDocumentEditor

C#
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

//Adds a new run to the document.
Run runFirst = editor.InsertText("First run ");

//Adds a new run and starts a new paragraph.
Run runSecond = editor.InsertLine("Second run");

Modifying a Run

The Run element exposes several properties that allow you to customize how it is rendered and formatted. Some of these properties are style properties, and some of the values represent a themable object.

Style properties are properties that can be inherited from a style. For more information about styles, refer to the Style Properties article.

Themable objects are objects that can be inherited from a theme. For more information about themes, refer to the Document Themes article.

  • Properties: Retrieves all CharacterProperties for this element. For more information about CharacterProperties, refer to the Style Properties article.

  • Text: Specifies the text for the run.

  • FlowDirection: Represents the flow direction of the run:

    • LeftToRight: Indicates that the text flows from left to right.
    • RightToLeft: Indicates that the text flows from right to left.
  • StyleId: Represents the ID of the style that is applied to this run.

  • FontFamily: Specifies the font family that is used to render the text. This is a style property. The value is a themable object.

  • FontSize: The font size. The measurement unit used for font size is Device Independent Pixels (DIPs). You can convert it to points or other units using the Unit class.

  • Shading: Represents the shading applied to the run. It is a composite object and is read-only. You can obtain the following properties from it:

    • BackgroundColor: Specifies the background color for the shading. This is a style property. The value is a themable object.
    • PatternColor: Specifies the pattern color for the shading. This is a style property. The value is a themable object.
    • Pattern: Specifies the pattern that is used to lay the pattern color over the background color for the shading. This is a style property.
  • FontStyle: Specifies the font style. This is a style property.

  • FontWeight: Specifies the font weight. This is a style property.

  • ForegroundColor: Specifies the foreground color. This is a style property. The value is a themable object.

  • HighlightColor: Specifies the highlight color. This is a style property.

  • BaselineAlignment: Specifies how the baseline is positioned on the vertical axis, relative to the established baseline for text. This is a style property.

  • Strikethrough: Specifies whether the text is struck through. This is a style property.

  • Underline: Specifies the underline for the run. It is a composite object and is read-only. You can obtain the following properties from it:

    • Color: Indicates the underline color. This is a style property.
    • Pattern: Indicates the underline pattern. This is a style property.

See Also