Focus events (GotFocus, LostFocus) are raised inconsistently for RadRichTextBox, due to the internal translation of the focus to the Caret. Scenarios: 1. Clicking inside the control, when the focus is already inside the control, triggers LostFocus, GotFocus, LostFocus, GotFocus events. 2. Switching internal editors (headers/footers) raises GotFocus and LostFocus. 3. If the control is inherited and OnGotFocus/OnLostFocus are overriden, they are never called (despite OnGotFocus one time in the beginning The behavior is problematic, as this events are useful for custom validation scenarios.
The exception is thrown by the SystemFontsManager internal class from Telerik.Windows.Documents.Core, so it can observed when using RadPdfViewer, RadRichTextBox, RadSpreadsheet. The reason is not clear, posssible causes are: - Corrupted fonts after upgrade from Windows XP - Enabling of Block untrusted fonts feature (https://docs.microsoft.com/en-us/windows/threat-protection/block-untrusted-fonts-in-enterprise ) The call stack is as follows: System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Core.Fonts.SystemFontsManager' threw an exception. ---> System.IO.FileNotFoundException: Unable to find the specified file. at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr) at MS.Internal.Text.TextInterface.FontList.get_Item(UInt32 A_0) at MS.Internal.Text.TextInterface.FontList.FontsEnumerator.get_Current() at MS.Internal.FontFace.TypefaceCollection.Enumerator.get_Current() at System.Windows.Media.Fonts.TypefaceCollection.<GetEnumerator>d__11.MoveNext() at Telerik.Windows.Documents.Core.Fonts.SystemFontsManager..cctor() Workaround: Manually delete all registry key values in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts pointing to files outside of the Fonts folder.
If header/footer containing annotations is set to a document using RadDocumentEditor.ChangeSectionHeader or ChangeSectionFooter methods, the annotations in the body of the header/footer are not paired in the resulting document. When such document is exported to XAML, NullReferenceException is thrown in the ReindexAnnotationMarkers internal method. Workaround: - Do not use RadDocumentEditor to set the footer: //editor.ChangeSectionFooter(radDocument.Sections.First, HeaderFooterType.Default, new Footer { Body = footerRadDocument }); radDocument.Sections.First.Footers.Default.Body = footerRadDocument; - Manually "fix" the cloned footer body before the export: ((ISupportInitialize)radDocument.Sections.First.Footers.Default.Body).EndInit();
Undoing changes to words wrapped in annotation ranges throw InvalidCastExceptions as AnnotationRangeStarts are casted to AnnotationRangeEnd. Steps to reproduce: 1. Add a bookmark to a word 2. Add a bookmark to the following word in the document 3. Use the find dialog to highlight those two words 4. Bold the text 5. Press Ctrl+Z to undo Observed: Repeated InvalidCastException dialogs Fix available in LIB Version 2018.1.430.
Annotation Ranges where SkipPositionBefore is set to false on the AnnotationRangeEnd cause cursor jumps when deleting content to the right of the Annotation Range. Steps to reproduce: 1. Open a job with Annotation Ranges where SkipPositionBefore is set to false on the AnnotationRangeEnd (I used the Document Protection sample in the demo app) 2. Move your cursor to the end of the range. 3. Hit the delete key Expected: The cursor remains at the end of the AnnotationRange and content to the right is deleted. Actual: Content to the right is deleted but eventually the cursor will jump to the right by one position and end up outside the Annotation Range.
Implement Auto Text gallery for inserting text. More information related to Auto Text can be found on the following post: https://support.office.com/en-us/article/automatically-insert-text-0bc40cab-f49c-4e06-bcb2-cd43c1674d1b
After merging a document into another one (or pasting it), some of the content is duplicated. The issue is a regression in R3 2018.
Adding bookmarks with the same name programmatically always returns the first one in case use attempts to navigate to it using the Bookmarks dialog.
Workaround: Remove the bookmark before adding a new one with the very same name.
Use the attached project to reproduce.
- Click the "Go To endPosition" button. The Caret remains on the same line.
private void radRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
if (e.Command is DeleteCommand && imageToDelete!=null)
{
this.radRichTextBox.Document.Selection.Clear();
this.radRichTextBox.Document.Selection.AddDocumentElementToSelection(imageToDelete);
this.radRichTextBox.Delete(true);
this.imageToDelete = null;
}
}
private ImageInline imageToDelete;
void radRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is DeleteCommand)
{
var selectedBoxes = this.radRichTextBox.Document.Selection.GetSelectedBoxes().ToList();
if (selectedBoxes.Count() == 2 && selectedBoxes[0].AssociatedInline is FieldRangeStart && selectedBoxes[1].AssociatedInline is ImageInline)
{
imageToDelete = selectedBoxes[1].AssociatedInline as ImageInline;
}
}
}