Unplanned
Last Updated: 01 Jun 2021 09:37 by ADMIN
Morten
Created on: 01 Jun 2021 09:37
Category: RichTextBox
Type: Bug Report
0
RichTextBox: The default styles are not copied when using the CreateDocumentFromSelection method

The default styles are not copied when using the CreateDocumentFromSelection method.

Workaround: Manually copy the styles:

var document = radRichTextBox.Document.Selection.CreateDocumentFromSelection();
document.StyleRepository.Clear();
foreach (var item in radRichTextBox.Document.StyleRepository)
{
    var style = new StyleDefinition(item);
    document.StyleRepository.Add(style);
}

0 comments