<!DOCTYPE html>
<html>
<body>
<div><p>RadDocument</p></div>
<div>Document</div>
</body>
</html>
Dear all,
Exporting partially-selected annotation ranges (annotation markers around selection or only one annotation marker in the selection) with a DocumentFragment from a RadDocument does not seem possible (the DocumentFragment contains none of these annotation ranges).
For example, if I have a document ("[", "]" are the annotation markers):
"Test [annotated]",
select "Test [ann" and create a DocumentFragment, the Document fragment will contain "Test ann" and not "Test [ann]".
PS.: I am not sure if this falls into the feature request or bug report area.
The RtfFormatProvider does not take the fonts from the Font.Manager
Workaround:
Unregister all custom fonts and the use the FontSubstituting event to supply the correct fonts:
private void ImportSettings_FontSubstituting(object sender, Telerik.Windows.Documents.FormatProviders.FontSubstitutingEventArgs e)
{
var fonts = Wpf.Fonts.Fonts.GetAllAvailableFonts();
var ff = fonts.Where(x => x.Source == e.OriginalFontName).FirstOrDefault();
e.SubstitutionFontFamily = ff;
}
After the import is complete you can register the fonts again.
Hello,
In the attached example, applying character formatting to a selection that ends between two annotation ends and undoing the formatting action does not revert the annotations to the exact position as they were before the formatting was applied.
Applying formatting twice and undoing twice crashes the editor because the second undo command inserts unpaired annotations (as it operates on a document state different than the expected one).
Paste some text inside RadRichTextEditor. If the text has more rows than the currently visible area you will see that the control does not scroll down to the caret position.
Workaround:
private void RadRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
if (e.Command is PasteCommand)
{
Application.DoEvents();
bool cursorAtDocEnd = this.radRichTextBox.Document.CaretPosition.IsPositionAtDocumentEnd;
if (cursorAtDocEnd)
{
MoveCaretCommand command = new MoveCaretCommand(this.radRichTextBox.RichTextBoxElement);
command.Execute(MoveCaretDirections.Down);
}
}
}