How to reproduce: create a table with 1px of the inner borders and 3px of the outer borders. The attached screenshots demonstrates the issue. A similar result can be also observed with other widths as well.
When you have more than one RadRichTextEditor controls on the form and you have selected text in both of theme, only the focused RadRichTextEditor should show the selection.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is SaveCommand) { DocumentPosition initial = this.radRichTextEditor1.Document.CaretPosition; DocumentPosition start = new DocumentPosition(initial); DocumentPosition end = new DocumentPosition(initial); var spans = this.radRichTextEditor1.Document.EnumerateChildrenOfType<Span>(); foreach (var span in spans) { if (span.FontStyle != FontStyle.Regular) { continue; } start.MoveToInline(span); end.MoveToEndOfDocumentElement(span); this.radRichTextEditor1.Document.Selection.AddSelectionStart(start); this.radRichTextEditor1.Document.Selection.AddSelectionEnd(end); this.radRichTextEditor1.RichTextBoxElement.Commands.ChangeFontFamilyCommand.Execute("Calibri"); } this.radRichTextEditor1.Document.CaretPosition.MoveToPosition(initial); } }
To reproduce: - Load a right to left document with Hebrew characters. - Export it to PDF - The characters' position is not correct.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, CommandExecutingEventArgs e) { if (!(e.Command is PasteCommand)) { return; } DocumentFragment res = ClipboardEx.GetDocumentFromClipboard("RadDocumentGUID"); if (res == null) { foreach (ClipboardHandler settings in ClipboardEx.ClipboardHandlers) { res = ClipboardEx.GetDocumentFromClipboard(settings.ClipboardDataFormat, settings.ClipboardStringFilter); } } if (res == null) { e.Cancel = true; System.Drawing.Image bitmapSource = Clipboard.GetImage(); if (bitmapSource == null) { return; } Telerik.WinForms.Documents.Layout.Padding sectionmargin = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection.ActualPageMargin; double originalPixelWidth = bitmapSource.Width; double originalPixelHeight = bitmapSource.Height; if (originalPixelWidth == 0 || originalPixelHeight == 0) { originalPixelWidth = 10; originalPixelHeight = 10; } double width = originalPixelWidth; double height = originalPixelHeight; if (this.radRichTextEditor1.Document.LayoutMode == DocumentLayoutMode.Paged) { Section currentSection = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; Telerik.WinForms.Documents.Model.SizeF pageSize = (Telerik.WinForms.Documents.Model.SizeF)currentSection.GetType().GetProperty("ActualPageSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(currentSection); double maxWidth = pageSize.Width - (sectionmargin.Left + sectionmargin.Right); double maxHeight = pageSize.Height - (sectionmargin.Top + sectionmargin.Bottom); width = Math.Min(maxWidth, width); height = Math.Min(maxHeight, height); } double ratio = originalPixelWidth / originalPixelHeight; width = Math.Min(width, height * ratio); height = width / ratio; Telerik.WinControls.RichTextEditor.UI.Size size = new Telerik.WinControls.RichTextEditor.UI.Size(width, height); ImageInline imageInline = new ImageInline(new WriteableBitmap(bitmapSource)); imageInline.Size = size; this.radRichTextEditor1.RichTextBoxElement.ActiveDocumentEditor.InsertInline(imageInline); } }
Workaround: Handle the CommandExecuted event and change the font family after executing the paste command: private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e) { if (e.Command is PasteCommand) { foreach (var p in this.radRichTextEditor1.Document.EnumerateChildrenOfType<Paragraph>()) { if (p.IsInList) { var list = this.radRichTextEditor1.Document.ListManager.GetDocumentListById(p.ListId); list.ActualStyle.Levels[0].FontFamily = new Telerik.WinControls.RichTextEditor.UI.FontFamily("Symbol"); } } } }
Pressing Tab/Shift+Tab when caret position is at the beginning of a paragraph should change current paragraph FirstLineIndent instead of LeftIndent. First line indent should be changed to Document.DefaultTabWidth step. Workaround: private void RadRichTextEditor1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData != Keys.Tab) { return; } this.radRichTextEditor1.Insert("\t"); e.SuppressKeyPress = true; e.Handled = true; }
Add support for All Capitals (All caps) and Small Capitals (Small caps) run property. MS Word has such option in Home -> Font -> Dialog Launcher -> Font -> All Caps/Small Caps. All letters of such runs are visualized as capital letters. The corresponding elements in OOXML are <w:caps /> and <w:smallcaps />.
Add only a RichTextEditorRibbonBar without any other control on the form. If you run the application you will notice that it loads more than one second. We should investigate if it is possible and how to improve the initialization time.
In certain fonts the caret is drawn on part of the last inputted character
There is an issue with the way the editor decides what width to render a table. The example I have encountered is in an HTML email from Outlook that contained a table. Whatever way Outlook composes the HTML, it adds a width attribute and a style attribute to the table's opening tag: <table width="0" style="width: 500px;"> In this situation, the inline style should take precedence over the width attribute (the width attribute is actually deprecated as of HTML5). This is how all common browsers behave. You can see in the attached 1_browser.png that Chrome correctly renders the table at 500px; However the RadRichtextEditor component incorrectly renders the table at width 0 as shown in attached 2_RadRichtextEditor.png, ignoring the width specified in the style attribute. Curiously, other CSS rules in the style attribute are correctly interpreted. For example: <table width="0" style="width: 500px;font-weight:bold;"> will display a table of zero width with bold text in the RadRichTextEditor. Thanks guys!
Workaround: To clear a given property, basing on some logic which determines if it should be cleared. For example this.radRichTextEditor1.CommandExecuting += (s, e) => { if (e.Command is ChangeStyleNameCommand) { var style = this.radRichTextEditor1.Document.StyleRepository.GetValueOrNull(e.CommandParameter.ToString()); if (style.Type == Telerik.WinForms.Documents.Model.Styles.StyleType.Paragraph) { Paragraph paragraph = this.radRichTextEditor1.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph; foreach (Span span in paragraph.EnumerateChildrenOfType<Span>()) { span.ClearValue(Span.FontFamilyProperty); span.ClearValue(Span.FontSizeProperty); } } } };
To reproduce: - Open the demo application. - Go to the Table Styles example. - Open the TableBorders dialog from the context menu and hit reset all.