Unplanned
Last Updated: 20 Nov 2017 12:09 by ADMIN
ADMIN
Hristo
Created on: 10 Nov 2017 14:57
Category: RichTextEditor
Type: Bug Report
0
FIX. RadRichTextEditor - creating document from selection doesn't copy styles when used as a Next style
1. Create a document containing a style with NextStyleName:

           StyleDefinition myStyle = new StyleDefinition();
            myStyle.Type = StyleType.Table;
            myStyle.DisplayName = "My Style";
            myStyle.Name = "myStyle";
            myStyle.NextStyleName = RadDocumentDefaultStyles.HyperlinkStyleName;

            this.radRichTextBox.Document.StyleRepository.Add(myStyle);

2. Add several paragraphs and select some of them (ensure there is one using our custom style).

3. Create a DocumentFragment using the selection's CopySelectedDocumentElements

4. Convert the fragment to RadDocument and try to export it

Observed: When exporting to DOCX and XAML, the style is missing. Exporting to RTF causes KeyNotFoundException.

Expected: The style should be preserved in the exported document

Workaround: After creating the document from the fragment, ensure all needed styles are copied and available.

0 comments