New to Telerik Document ProcessingStart a free 30-day trial

Style Properties

Updated on Feb 19, 2026

Style property is part of the style system, used to hold information about a formatting value of the document elements. It can be used to check if the value is local or it is inherited from base style. Information about how the style system works and how values are inherited from base styles can be found in the Style Evaluation and Inheritance section of the Styles article.

Style Property Implementation Overview

Style properties are exposed through IStyleProperty<T> interface, which contains the following properties and methods:

  • LocalValue: Used to get or set the local value. If it is not set, the value is null.

  • HasLocalValue: Returns value indicating whether the style property has local value.

  • GetActualValue(): Returns the actual value of the property. This value is evaluated on every call by the style system using the evaluation rules described in the Styles article.

  • ClearValue(): Clears the local value.

  • PropertyDefinition: The property definition is exposed through the IStylePropertyDefinition interface and specifies some details for the style property as:

    • PropertyName: Returns the name of the style property.
    • StylePropertyType: Returns the type of the style property.
    • Validation: Used to determine if a value is valid for this style property.
    • GetDefaultValueAsObject(): This method returns the default value as object.

Some of the style properties always contain local value and are normally referred to as local style properties. They are used only by the document elements and their values are not respected by styles and style inheritance.

Style Property Definitions

Style property definition is represented by the StylePropertyDefinition<T> class and can be accessed from the style property itself (through its base interface IStylePropertyDefinition) or as a static member of Run, Paragraph, Table, TableRow and TableCell document elements. Style property definitions specify the following details of the style property:

  • PropertyName: Specifies the name of the style property.
  • DefaultValue: Specifies the default value of the style property.
  • StylePropertyType: Specifies the type of the style property as StylePropertyType enumeration.
  • Validation: Used to determine if a value is valid for the style property associated with this style property definition.

Using Style Properties

Style Properties in Document Elements

Document elements expose sets of style properties through the Properties property. For convenience, style properties can be also used through CLR shorthand properties exposed directly from the document elements. Shorthand property getter gets the actual value of the property while property setter sets the local value of the property.

Example 1 is an example for equivalent getting of a value with CLR property and style property.

Example 1: Get a value

c#
bool keepOnOnePageActualValueShorthand = paragraph.KeepOnOnePage;
bool keepOnOnePageActualValue = paragraph.Properties.KeepOnOnePage.GetActualValue().Value;

Example 2 is an example for an equivalent setting of a value with CLR property and style property.

Example 2: Set a value

c#
paragraph.KeepOnOnePage = true;
paragraph.Properties.KeepOnOnePage.LocalValue = true;

Style Properties in Styles

The style properties in a style are accessible through the following property sets: CharacterProperties, ParagraphProperties, TableProperties, TableRowProperties and TableCellProperties.

Example 3 illustrates how to get the local value of a style property in a style.

Example 3: Get the local value

c#
bool? keepOnOnePage = style.ParagraphProperties.KeepOnOnePage.LocalValue;

Example 4 shows how to get the actual value of style property in style.

Example 4: Get the actual value

c#
bool keepOnOnePageActual = style.ParagraphProperties.KeepOnOnePage.GetActualValue().Value;

Style Properties Default Values

The default values of all style properties are available in their StylePropertyDefinitions and cannot be changed. To set the default values of properties for a particular document, you can change the default styles for the document.

The code in Example 5 illustrates how to get the default value for a style property.

Example 5: Get the default value

c#
bool keepOnOnePageDefaultValue = Paragraph.KeepOnOnePagePropertyDefinition.DefaultValue.Value;

Following is a list of all available style properties and their default values:

NameDescriptionDefault Value
CharacterProperties
FontFamilyThe font family.Verdana
FontSizeThe size of the font. The value is in device independent pixels (1/96 inch).13.3333333333333
FontStyleThe font style.Normal
FontWeightThe font weight.Normal
ForegroundColorThe foreground color.Black
HighlightColorThe color of the highlight.Transparent
BaselineAlignmentThe baseline alignment.Baseline
StrikethroughThe strikethrough.False
BackgroundColorThe color of the background.Transparent
ShadingPatternColorA value indicating the color for any foreground pattern used in this shading.Transparent
ShadingPatternA value indicating the pattern which shall be used to lay the pattern color over the background color for this shading.Clear
UnderlineColorThe color for the underlining.Auto(#FF000000)
UnderlinePatternA value indicating the pattern which shall be used to create the underlining applied beneath the text.None
FlowDirectionThe flow direction.LeftToRight
ParagraphProperties
FlowDirectionThe flow direction.LeftToRight
TextAlignmentThe paragraph text alignment.Left
SpacingBeforeThe spacing that should be added above the first line in a paragraph. The value is in device independent pixels (1/96 inch).0
AutomaticSpacingBeforeA value indicating whether a consumer shall automatically determine the spacing before the paragraph based on its contents the automatic spacing after.False
SpacingAfterThe spacing that should be added after the last line in a paragraph. The value is in device independent pixels (1/96 inch).0
AutomaticSpacingAfterA value indicating whether a consumer shall automatically determine the spacing after the paragraph based on its contents the automatic spacing after.False
LineSpacingThe value indicating the amount of vertical spacing between lines of text within a paragraph. If is Auto then the line height value times the value of the property, otherwise the value is in device independent pixels (1/96 inch).1
LineSpacingTypeThe value indicating how the spacing between lines is calculated.Auto
KeepOnOnePageA value indicating if this paragraph should be rendered on one page when the document is shown in page view mode.False
KeepWithNextParagraphA value indicating if this paragraph should be rendered at least partly on the one page with the following paragraph when this is possible and when the document is shown in page view mode.False
OutlineLevelA value indicating the outline level. The outline level defines the level of this paragraph in TOC field.None
ApplyEastAsianLineBreakingRulesA value indicating whether East-Asian line breaking rules are applied to this paragraph.True
PageBreakBeforeA value indicating if this paragraph should be rendered on new page when the document is shown in page view mode.False
BordersThe paragraph borders.None
ContextualSpacingA value indicating whether spacing before/after are ignored when preceding/following paragraph has same paragraph style.False
MirrorIndentsA value indicating whether left and right indents should be swapped on odd pages.False
BackgroundColorThe color of the background.Transparent
ShadingPatternColorA value indicating the color for any foreground pattern used in this shading.Transparent
ShadingPatternA value indicating the pattern which shall be used to lay the pattern color over the background color for this shading.Clear
FirstLineIndentA value indicating the additional indentation which shall be applied to the first line of the paragraph. The value is in device independent pixels (1/96 inch).0
HangingIndentA value which shall be removed from the indentation of the first line of the paragraph, by moving the indentation on the first line back towards the beginning of the direction of text flow. The value is in device independent pixels (1/96 inch).0
LeftIndentA value indicating the indentation which shall be applied to the left side of the whole paragraph. The value is in device independent pixels (1/96 inch).0
RightIndentA value indicating the indentation which shall be applied to the right side of the whole paragraph. The value is in device independent pixels (1/96 inch).0
AllowOverflowPunctuationA value indicating whether the last punctuation character on a line can overflow in paragraph margin/indent. This property cannot be derived from a style.True
TabStopsThe tab stops in the paragraph.
ListIdA value indicating that the paragraph is referencing a list.-1
ListLevelA value indicating that the paragraph is referencing list level.-1
TableProperties
AlignmentThe alignment of the table.Left
BackgroundColorThe color of the background.Transparent
ShadingPatternColorA value indicating the color for any foreground pattern used in this shading.Transparent
ShadingPatternA value indicating the pattern which shall be used to lay the pattern color over the background color for this shading.Clear
BordersThe table border.None
TableCellPaddingDefault padding of the cells inside the table.0, 0, 0, 0
TableCellSpacingA value indicating the spacing between adjacent cells and the edges of the table. The value is in device independent pixels (1/96 inch).0
IndentA value which shall be added before the leading edge of the table. The value is in device independent pixels (1/96 inch).0
RowBandingThe number of banded rows.0
ColumnBandingThe number of banded columns.0
FlowDirectionThe flow direction of cells inside the table. This property cannot be derived from a style.LeftToRight
PreferredWidthThe preferred width. This property cannot be derived from a style.Auto
LooksThe value indicating which components of the conditional style should be applied if such exists. This property cannot be derived from a style.BandedRows, BandedColumns
LayoutTypeA value indicating which algorithm shall be used to lay out the content of the table. This property cannot be derived from a style.AutoFit
OverlapA value indicating whether this floating table shall allow other floating tables to overlap its extents. This property cannot be derived from a style.True
TableRowProperties
TableCellSpacingA value indicating the spacing between adjacent cells and the edges of the table. The value is in device independent pixels (1/96 inch).0
RepeatOnEveryPageA value indicating whether this row should be repeated on every new page. This property cannot be derived from a style.False
CanSplitA value indicating whether the content of the row can be split across multiple pages. This property cannot be derived from a style.True
HeightThe height. This property cannot be derived from a style.Auto
TableCellProperties
BordersThe borders.None
BackgroundColorThe color of the background.Transparent
ShadingPatternColorA value indicating the color for any foreground pattern used in this shading.Transparent
ShadingPatternA value indicating the pattern which shall be used to lay the pattern color over the background color for this shading.Clear
PaddingThe padding.7.68, 0, 7.68, 0
ColumnSpanThe column span. This property cannot be derived from a style.1
RowSpanThe row span. This property cannot be derived from a style.1
IgnoreCellMarkerInRowHeightCalculationA value indicating whether cell marker will be ignored when row height is calculated. This property cannot be derived from a style.False
CanWrapContentA value indicating whether the content can be wrapped during the table layout. This property cannot be derived from a style.True
PreferredWidthThe preferred width. This property cannot be derived from a style.Auto
VerticalAlignmentThe vertical alignment. This property cannot be derived from a style.Top
TextDirectionThe text direction. This property cannot be derived from a style.LeftToRightTopToBottom
SectionProperties
HasDifferentFirstPageHeaderFooterHas different first page header footer.False
PageOrientationPage orientation property.Rotate0
PageSizePage size property. The width and height are in device independent pixels (1/96 inch).816,1056
PageMarginsPage margins property.96, 96, 96, 96
HeaderTopMarginHeader top margin property. The value is in device independent pixels (1/96 inch).48
FooterBottomMarginFooter bottom margin property. The value is in device independent pixels (1/96 inch).48
SectionTypeSection type property.NextPage
VerticalAlignmentVertical alignment property.Top
ChapterSeparatorCharacterChapter separator character that shall appear between the chapter heading style index and the page number.
ChapterHeadingStyleIndexIndex of the chapter heading style.
PageNumberFormatPage number format for the page numbering in the current section.
StartingPageNumberStarting page number. This number appears on the first page of the section.
DocumentProperties
HasDifferentEvenOddPageHeadersFootersA value indicating whether pages in this document will have different headers and footers for even and odd pages.False
ViewTypeA value indicating the view type of the document.PrintLayout
DefaultTabStopWidthStyle property used to determine the default width value which shall be used when a tab stop should be generated. The value is in device independent pixels (1/96 inch).48

See Also