New to Telerik UI for WinForms? Download free 30-day trial

RadDocument

RadDocument is the root element for RadRichTextBox's content. It holds the collection of Sections defined for the RadRichTextBox content. It also allows you to configure the appearance of its child elements. Currently only one section in the document is supported and all declared sections are merged into one when the document is measured.

This topic will explain how you can customize the contents of the RadDocument

Customize the contents of the RadDocument

RadDocument exposes several properties that allow you to customize the layout of the elements placed underneath it. Here is a list of them:

  • DefaultPageLayoutSettings - this property is of type PageLayoutSettings. The PageLayoutSettings class exposes the following properties:

    • Height - represents the height of the page.

    • Width - represents the width of the page.

The DefaultPageLayoutSettings get applied only when Paged layout mode is used.

  • LayoutMode - specifies whether the page should be in Paged or Flow layout mode. To learn more about layout modes read here.

  • LineSpacing - specifies the value for the space between the lines.

  • LineSpacingType - specifies the type of spacing:

    • AtLeast - the space between the lines should equal or greater than the value of the LineSpacing property.

    • Auto - the space between the lines is determined automatically.

    • Exact - the space between the lines should equal to the value of the LineSpacing property.

  • PageViewMargin - represents the margins of the pages towards the RadRichTextBox borders.

  • ParagraphDefaultSpacingAfter - defines the default spacing after each of the paragraphs in the RadDocument. To assign different spacing after each of the paragraphs use the respective property of the Paragraph class.

  • ParagraphDefaultSpacingBefore - defines the default spacing before each of the paragraphs in the RadDocument. To assign different spacing before each of the paragraphs use the respective property of the Paragraph class.

  • SectionDefaultPageMargin - defines the default margin for each of the sections in the RadDocument. To assign different margins for each of the sections use the respective property of the Section class.

  • ShowFormattingSymbols - indicates whether the formatting symbols should be displayed or not.

In this article