If you want to change any of the following properties (FontFamily, FontSize, FontStyle or FontWeight) you can do it directly in xaml or in code behind by setting the respective property and setting DocumentInheritsDefaultStyleSettings
to true as described in this article
If you want to change some of the properties of the paragraph or the table, you can do it only in code behind by accessing the DefaultStyleSettings property of RadRichTextBox as shown bellow:
this.editor.DocumentInheritsDefaultStyleSettings = true;
this.editor.DefaultStyleSettings.ParagraphProperties.Background = Colors.Yellow;
this.editor.DefaultStyleSettings.ParagraphProperties.TextAlignment = RadTextAlignment.Center;
In this way when you change the document of the RadRichTextBox those properties will be synchronized and will be applied on the new document.
There is another way to change the default style of a specific document by using the Style property of the document like this:
this.editor.Document.Style.SpanProperties.ForeColor = Colors.Brown;
this.editor.Document.Style.ParagraphProperties.Background = Colors.Green;
Notice that those changes are with higher priority and will override the default style of RadRichTextBox. Also those changes will not be applied if another document is shown.
If you have further questions, do not hesitate to contact us again.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>