Hello.
We are currently testing the RadRichTextBox control and due to our specific business needs we cannot use the ribbon UI so we are applying styles programmatically.
We are using the sample code from the documentation which describes how to apply a linked style however it does not work in our case - only the paragraph style is applied but the character one is ignored.
Our environment is VS 2017.
.NET Framework 4.6.2. (tried with 4.5 but got the same result).
Here is the code:
StyleDefinition linkedParagraphStyle = new StyleDefinition();
linkedParagraphStyle.Type = StyleType.Paragraph;
linkedParagraphStyle.ParagraphProperties.Background = Colors.Yellow;
linkedParagraphStyle.DisplayName = "linkedParagraphStyle";
linkedParagraphStyle.Name = "linkedParagraphStyle";
StyleDefinition linkedCharStyle = new StyleDefinition();
linkedCharStyle.Type = StyleType.Character;
linkedCharStyle.SpanProperties.FontWeight = FontWeights.Bold;
linkedCharStyle.SpanProperties.FontFamily = new FontFamily("Times New Roman");
linkedCharStyle.DisplayName = "linkedCharStyle";
linkedCharStyle.Name = "linkedCharStyle";
linkedParagraphStyle.LinkedStyle = linkedCharStyle;
this.textBox.Document.StyleRepository.Add(linkedParagraphStyle);
this.textBox.Document.StyleRepository.Add(linkedCharStyle);
this.textBox.ChangeStyleName("linkedCharStyle");
No matter how we change the linking and the naming of the styles and linked properties it will not apply the character properties.
Any help would be greatly appreciated.
Regards,
R.F.