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 the content of an entire row is copied and the caret is inserted in the left most column of a row, then the content of each cell in that row should be overwritten with the contents in the clipboard when pasted. When such content is pasted just after a table, new row is added and filled with values. When such content is pasted in paragraph, new table is created.
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"); } } } }
When CJK text (Chinese, Korean, Japanes) is copied from WordPad and paste into RadRichTextBox text, the characters are imported incorrectly (as '?' and as different characters). The same applies if WordPad document containing CJK is imported from RTF. The problem is related to the specified \fcharset134 RTF tag, which is not properly interpreted.
How to reproduce: check the attached gif file
Please refer to the attached screenshots. A sample .docx file is attached. Just load it in RadRichTextEditor.
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, 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); } }
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; }
Implement commands and UI for producing labels using Mail Merge. Behind the scenes this is implemented as Table with the proper number of table columns and rows, and eventually (depending on the setup) NEXT field (https://support.office.com/en-us/article/Field-codes-Next-field-3862fad6-0297-411a-a4e7-6ff5bcf178fd?ui=en-US&rs=en-US&ad=US) - so this will eventually require implementing NEXT field. Note: In MS Word, this is in Mailings -> Start Mail Merge -> Labels...
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 />.
In certain fonts the caret is drawn on part of the last inputted character