To reproduce: - Add some misspelled words. - Enable the spell check - the layout is updated and the words are underlined. - Disable the spell check - the lines are not removed until one clicks in the RichTextEditor. Workaround: radRichTextEditor1.IsSpellCheckingEnabled = !radRichTextEditor1.IsSpellCheckingEnabled; radRichTextEditor1.Document.LayoutMode = DocumentLayoutMode.Paged; radRichTextEditor1.Document.LayoutMode = DocumentLayoutMode.Flow;
html tables cannot be properly pasted in word when imported table size is defined in "pt". consider adding the a table like this as well: <html> <body> <table border="1"> <tbody> <tr> <td>A</td> <td>B</td> <td>C</td> </tr> <tr> <td>A1</td> <td>B1</td> <td>C1</td> </tr> </tbody> </table> </body> </html>
To reproduce: - Paste some text with a barcode font in a RadRichTextBox. - Export to a pdf document. - In the pdf document the text is not displayed as barcode.
Workaround: string styleSuffix = "_1"; foreach (var importedStyle in rtfDoc.StyleRepository) { importedStyle.Name = string.Concat(importedStyle.Name, styleSuffix); }
Invisible borders in html format are imported as black borders in RadRichTextBox Resolution: This issue is addressed in the new version of the control - RadRichTextEditor. Please use the new control instead the RadRichTextBox.
To reproduce: - insert a fragmet from another RichtextEditor like this: private void Button_Click(object sender, RoutedEventArgs e) { radRichTextBox.Document.Sections.Clear(); radRichTextBox.Document.Sections.Add(new Section()); radRichTextBox.Document.CaretPosition.MoveToLastPositionInDocument(); radRichTextBox.DocumentEditor.InsertParagraph(); radRichTextBox.DocumentEditor.InsertFragment(new DocumentFragment(radRichTextEditor1.Document)); radRichTextBox.DocumentEditor.InsertParagraph(); } Workaround: There is no point of resetting the section in such way. Nevertheless, you can avoid the exception by using one of the following methods: radRichTextBox.Document.MeasureAndArrangeInDefaultSize(); radRichTextBox.UpdateEditorLayout();
To reproduce: - Copy the content from the attached document - do not copy the last row. - Remove the bookmarks like this: bookmarks = radRichTextEditor1.Document.GetAllBookmarks().ToArray(); foreach (BookmarkRangeStart item in bookmarks) { radRichTextEditor1.Document.GoToBookmark(item); radRichTextEditor1.DocumentEditor.DeleteBookmark(item); } Workaround: var invalidStarts = this.radRichTextBox.Document .EnumerateChildrenOfType<BookmarkRangeStart>() .Where(start => start.End == null) .ToList(); foreach (var invalidStart in invalidStarts) { invalidStart.Parent.Children.Remove(invalidStart); } Note that when this workaround is used the document history will be deleted as well, which means that the undo operation will no longer hold information for previous operations
Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radRichTextEditor1.IsSpellCheckingEnabled = true; this.radRichTextEditor1.Insert("SOooome wrrrrong wooooooooords."); this.radRichTextEditor1.CommandExecuted += radRichTextEditor1_CommandExecuted; } bool shouldProcess = true; private void radRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e) { if (e.Command is DeleteCommand) { if (shouldProcess) { shouldProcess = false; RichTextEditorInputBehavior behavior = this.radRichTextEditor1.InputHandler; behavior.ProcessKeyDown(new KeyEventArgs(Keys.Back)); } shouldProcess = true; } } }
To reproduce: - Insert the following HTML vide the HtmlFormatProvider: "<!DOCTYPE html><html><head><title>test</title> <body><span >Hello,</span><p ><span >Kind regards,</span></p> <br /> <span >Test</span><p><a href=\"#\"><span>Hyperlink</span></a><span ><br /></span><span >test: 0</span><span ><br /></span><span>Test</span><span </span></p></body></html>" - Start the application place the caret in front of the link and press the tab key, you will notice that the text below the link is also moved. This behavior is also observed when the text box contains plain text or a imported rtf, just move the caret at the top left corner, in front of all text and press Tab.
The Docm (docx) and RTF files are not imported correctly. - Paragraph's alignment is not imported when RTF file is opened by RadRichTextBox - Importing of Docm (docx) file does not imports images and does not apply correct borders of table
The equation objects in word document are not copied and imported correctly in RadRichTextBox
To reproduce: Add image like this: void button_Click1(object sender, EventArgs e) { Section section = new Section(); Paragraph paragraph = new Paragraph(); ImageInline image; Telerik.WinControls.RichTextEditor.UI.Size size = new Telerik.WinControls.RichTextEditor.UI.Size(236, 50); using (MemoryStream ms = new MemoryStream()) { System.Drawing.Image.FromFile(@"C:\img\delete.png").Save(ms, System.Drawing.Imaging.ImageFormat.Png); image = new ImageInline(ms, size, "png"); } paragraph.Inlines.Add(image); section.Children.Add(paragraph); this.radRichTextEditor1.Document.Sections.Add(section); } Workaround: Manually update the layout: this.radRichTextEditor1.UpdateEditorLayout();
To reproduce: create a Word document with a table. Design a more complex table with nested tables in each cell. Specify "None" border for the internal tables. When loading the document in the RadRichTextBox, the borders are displayed.
If you export a document using the HtmlFormatProvider, all style properties which contain measurement units are exported in pixel units. This makes the exported documents look much smaller when opened on devices with higher pixel density. WORKAROUND: use Regex to find, convert and replace the font-size attributes HtmlFormatProvider html = new HtmlFormatProvider(); string res = html.Export(document); Regex regex = new Regex(@"font-size: [0-9]*\.?[0-9]*px"); Match match = null; do { match = regex.Match(res); if (!match.Success) { break; } string value = match.Value.Substring("font-size: ".Length, match.Value.Length - "font-size: ".Length - "px".Length); double pts = double.Parse(value) * 72 / 96; res = res.Replace(match.Value, @"font-size: " + Math.Round(pts, 4) + "pt"); } while (match.Success); File.WriteAllText("output.html", res);
To reproduce: radRichTextEditor.Document = new RadDocument(); radRichTextEditor.Document.MeasureAndArrangeInDefaultSize(); radRichTextEditor.UpdateEditorLayout(); radRichTextEditor.Document.CaretPosition.MoveToLastPositionInDocument(); var p = new Paragraph(); p.Inlines.Add(new Span("Cell")); var cell = new TableCell(); cell.Blocks.Add(p); var row = new TableRow(); row.Cells.Add(cell); var table = new Table(); table.Rows.Add(row); var section = new Section(); section.Blocks.Add(table); radRichTextEditor.Document.Sections.Add(section); radRichTextEditor.Document.CaretPosition.MoveToLastPositionInDocument(); var provider = new RtfFormatProvider(); var txt = provider.Export(radRichTextEditor.Document); Clipboard.SetText(txt, TextDataFormat.Rtf); Workaround: measure the document after the section is added: radRichTextEditor.Document.Sections.Add(section); radRichTextEditor.Document.MeasureAndArrangeInDefaultSize(); radRichTextEditor.UpdateEditorLayout();
To reproduce: RadDocument document = new RadDocument(); Section section = new Section(); Paragraph p = new Paragraph(); Span span = new Span(); span.Text ="test" + Environment.NewLine + "test"; ReadOnlyRangeStart rangeStart = new ReadOnlyRangeStart(); ReadOnlyRangeEnd rangeEnd = new ReadOnlyRangeEnd(); rangeEnd.PairWithStart(rangeStart); p.Inlines.Add(rangeStart); p.Inlines.Add(span); p.Inlines.Add(rangeEnd); section.Blocks.Add(p); document.Sections.Add(section); this.radRichTextEditor1.Document = document; Workaround: add an empty span as last inline element in the paragraph: RadDocument document = new RadDocument(); Section section = new Section(); Paragraph p = new Paragraph(); Span span = new Span(); span.Text ="test" + Environment.NewLine + "test"; ReadOnlyRangeStart rangeStart = new ReadOnlyRangeStart(); ReadOnlyRangeEnd rangeEnd = new ReadOnlyRangeEnd(); rangeEnd.PairWithStart(rangeStart); p.Inlines.Add(rangeStart); p.Inlines.Add(span); p.Inlines.Add(rangeEnd); /////////////////////////////////////// Span emptySpan = new Span(); emptySpan.Text = " "; p.Inlines.Add(emptySpan); /////////////////////////////////////// section.Blocks.Add(p); document.Sections.Add(section); this.radRichTextEditor1.Document = document;
1. Open RadRichTexEditor and type the following text: "שדג:3" or open the attached file 2. Save the document as docx file 3. Compare the results in MS Word and in RadRichTexEditor Observed result: in RadRichTexEditor the text is visualized as: ":3שדג" Expected result: The text should be visualized as: "שדג:3"