I have a problem whith the instruction selection.selectall() in a raddocument.
The last character is not be changed where I use the
UpdateSelectedSpansStyle to change forecolor and size of the text.
i use version 2010.3.1314 (jan 14, 2011) of radcontrols for silverlight
Thank you very much.
4 Answers, 1 is accepted
The last character in the document must be the paragraph-end symbol of the last paragraph and by design, it cannot be selected and its style cannot be changed.
If the last character in your document is not that symbol, the document's structure is invalid. This can happen if you manipulate programmatically the document structure after the document has been measured and arranged (which happens automatically when you show the RadRichTextBox on the screen).
If you want to change the font family and font size of the whole document, you can use RadRichTextBox's properties like this:
Setting them in XAML also works.
Let us know if you need further assistance. Greetings,
the Telerik team
I have a problem with RadDocument.SelectAll() method - it does not select last element in document; as you said, last paragraph is not closed (DocumentFragment.IsLastParagraphClosed is false).
I just import RadDocument from byte array, but do nothinig with document structure.
How can I add paragraph-end symbol?
How can I copy whole document?
(I need to paste content of one document into another document)
François's issue was different than the one you are encountering. You can test how in the demo if ShowFormattingSymbols is enabled, select all does not select the last paragraph-end symbol. This behavior is by design, but it does not affect copying or changing the formatting of the whole document.
In your case, the problem is that the document is not measured and arranged before you try to select and copy it. Please refer to this forum thread for the answer to your question. You need the following code in particular:
the Telerik team
Thanx a lot!