Expanding the table selection with the keyboard leaves the caret behind the selection's edges. After we pass the current cell content, the selection is automatically broadened over the next complete cell, but if we continue to press Shift+Arrow, it takes keystrokes = length of content in the cell + 1 to expand the selection to its next cell, though the selection highlights are already covering that cell.
There is a workaround: you will need to subscribe to the SelectionChanged event and use this code snippet for the event handler:
private void SelectionChanged(object sender, EventArgs e)
{
var selection = this.radRichTextBox.Document.Selection;
var caretPosition = this.radRichTextBox.Document.CaretPosition;
if (selection.IsEmpty)
{
return;
}
if (selection.Ranges.Last.IsReversed)
{
caretPosition.MoveToPosition(selection.Ranges.First.StartPosition);
}
else
{
caretPosition.MoveToPosition(selection.Ranges.Last.EndPosition);
}
}
Inside it, we move the caret to the selection's edges.
When trying to export a document containing InlineUIContainer inside a read-only range, the XamlWriter.Save() method that is used in XamlFormatProvider.Serialize() throws StackOverflow exception. Sample code to reproduce the exception: InlineUIContainer container = new InlineUIContainer(); Button btn = new Button(); btn.Content = "Sample Button"; btn.Width = 70; btn.Height = 30; container.UiElement = btn; ReadOnlyRangeStart start = new ReadOnlyRangeStart(); ReadOnlyRangeEnd end = new ReadOnlyRangeEnd(); end.PairWithStart(start); this.rtb.InsertInline(container); this.rtb.Document.Selection.SelectAll(); this.rtb.InsertAnnotationRange(start, end); XamlFormatProvider provider = new XamlFormatProvider(); string content = provider.Export(this.rtb.Document); File.WriteAllText(@"c:\temp\asd.xaml", content);
When a table is dragged after a page break, and then Undo/Redo is performed for the drag operation NullReferenceException is thrown.
In some complex script languages, like Telugu and Thai language, some characters are grouped (e.g. consonants + vowels) in new grapheme. For example, type 'p' in Telugu - 'జ', followed by 'ో' - they are combined in new grapheme - 'జో', or paste the following Thai grapheme: ชื UI correctly visualizes this, but: - Text measuring assumes that the grapheme width is equal to the sum of the widths of its parts (characters), which is not correct. Selection and caret position are scrambled because of this. - There are document positions between the grapheme parts (characters), but shouldn't. - When the caret is before the grapheme, deleting with "Delete" key deletes the grapheme in multiple steps (character by character), but should delete it in single step. Deleting with "Backspace" works correctly. - There are some unsupported combinations in some languages. For example in Thai, typing 'z' then 'y' will produce grapheme, but typing 'w' then 'y' will not produce grapheme, and the 'y' should be ignored.
KeyNotFoundException is thrown when loading a document with a custom bibliographic style applied.
As a workaround, you can change the current bibliographic style to one of the predefined styles before the export of the document.
...
this.radRichTextBox.CommandExecuting += RadRichTextBox_CommandExecuting;
...
...
private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
if (e.Command is SaveCommand)
{
this.radRichTextBox.ChangeBibliographicStyle(new APAFifthEditionStyle());
}
}