To reproduce: - Add some comments and try to navigate through them. - Try add or show/hide the comments while the cursor is in one of the comments. Workaround: Create a custom RichTextEditorRibbonBar and override the following methods: Public Class MyRichTextEditorRibbonBar Inherits RichTextEditorRibbonBar Protected Overrides Sub ButtonNewComment_Click(sender As Object, e As EventArgs) Dim command As New InsertCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub ButtonDeleteComment_Click(sender As Object, e As EventArgs) Dim command As New DeleteCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub ButtonPreviousComment_Click(sender As Object, e As EventArgs) Dim command As New GoToPreviousCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub ButtonNextComment_Click(sender As Object, e As EventArgs) Dim command As New GoToNextCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub ToggleButtonShowHideComments_ToggleStateChanged(sender As Object, args As StateChangedEventArgs) Dim command As New ToggleCommentsCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub ButtonDeleteAllComments_Click(sender As Object, e As EventArgs) Dim command As New DeleteAllCommentsCommand(Me.AssociatedRichTextEditor.RichTextBoxElement) Me.ExecuteCommand(command) End Sub Protected Overrides Sub HandleDocumentCommandExecuted(document As RadDocument) MyBase.HandleDocumentCommandExecuted(document) Dim hasComments As Boolean = Me.AssociatedRichTextEditor.Document.EnumerateChildrenOfType(Of CommentRangeStart)().Count() > 0 Me.buttonPreviousComment.Enabled = hasComments Me.buttonNextComment.Enabled = hasComments Me.buttonDeleteComment.Enabled = hasComments Me.buttonDeleteAllComments.Enabled = hasComments End Sub End Class
The RTF specifications states that the header of the document should start with "\rtfN" where N is the version of the RTF. Currently, the RtfFormatProvider do not save the version, but only "\rtf". Most software handles this case, but in some cases the document cannot be read.
How to reproduce: 1. Run the Mail Merge example (QSF) 2. Select the image inside the document and move it to another position
How to reproduce: public partial class Form1 : Form { RadRichTextBox tb1; RadRichTextBox tb2; private bool shouldFocus = false; public Form1() { InitializeComponent(); tb1 = new RadRichTextBox(); this.Controls.Add(tb1); tb2 = new RadRichTextBox(); tb2.Location = new Point(200, 0); this.Controls.Add(tb2); this.Load += Form1_Load; } private void Form1_Load(object sender, EventArgs e) { StyleDefinition style = new StyleDefinition(); tb1.IsReadOnly = true; tb1.Document.Insert("text 1", style); tb2.Document.Insert("text 2", style); tb2.IsReadOnly = true; } private void radButton1_Click(object sender, EventArgs e) { tb1.IsReadOnly = false; tb2.IsReadOnly = false; tb1.Focus(); } } Workaround: public partial class Form1 : Form { RadRichTextBox tb1; RadRichTextBox tb2; private bool shouldFocus = false; public Form1() { InitializeComponent(); tb1 = new RadRichTextBox(); tb1.GotFocus += tb1_GotFocus; tb1.LostFocus += tb1_LostFocus; this.Controls.Add(tb1); tb2 = new RadRichTextBox(); tb2.Location = new Point(200, 0); tb2.GotFocus += tb2_GotFocus; tb2.LostFocus += tb2_LostFocus; this.Controls.Add(tb2); this.Load += Form1_Load; } private void tb2_LostFocus(object sender, EventArgs e) { shouldFocus = false; tb2.IsReadOnly = true; } private void tb2_GotFocus(object sender, EventArgs e) { if (shouldFocus) { tb2.IsReadOnly = false; } } private void tb1_LostFocus(object sender, EventArgs e) { tb1.IsReadOnly = true; } private void tb1_GotFocus(object sender, EventArgs e) { if (shouldFocus) { tb1.IsReadOnly = false; } } private void Form1_Load(object sender, EventArgs e) { StyleDefinition style = new StyleDefinition(); tb1.IsReadOnly = true; tb1.Document.Insert("text 1", style); tb2.Document.Insert("text 2", style); tb2.IsReadOnly = true; } private void radButton1_Click(object sender, EventArgs e) { if (shouldFocus) { tb2.Focus(); } else { shouldFocus = true; tb1.Focus(); } } }
Workaround: public class CustomRadRichTextEditor : RadRichTextEditor { /// <summary> /// Gets or sets the width of the caret. /// </summary> [Browsable(false)] [Category(RadDesignCategory.AppearanceCategory)] public new float CaretWidth { get { float caretWidth = base.CaretWidth; if (float.IsNaN(caretWidth)) { return 2; } return caretWidth; } set { base.CaretWidth = value; } } }
How to reproduce: check the attached video Workaround: public partial class Form1 : Form { private RadButtonElement buttonHeader; private RadButtonElement buttonFooter; public Form1() { InitializeComponent(); this.buttonHeader = (RadButtonElement)this.richTextEditorRibbonBar1.GetType().GetField("buttonHeader", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.richTextEditorRibbonBar1); this.buttonFooter = (RadButtonElement)this.richTextEditorRibbonBar1.GetType().GetField("buttonFooter", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.richTextEditorRibbonBar1); this.radRichTextEditor1.RichTextBoxElement.IsInHeaderFooterEditModeChanged += RichTextBoxElement_IsInHeaderFooterEditModeChanged; } private void RichTextBoxElement_IsInHeaderFooterEditModeChanged(object sender, EventArgs e) { if (!this.radRichTextEditor1.RichTextBoxElement.IsInHeaderFooterEditMode) { this.buttonHeader.Enabled = true; this.buttonFooter.Enabled = true; } else { this.buttonHeader.Enabled = false; this.buttonFooter.Enabled = false; } } }
Trying to export a document which contains hyperlink pasted from Outlook throws KeyNotFoundException. The color of the span is not registered. Workaround: Telerik.WinForms.Documents.Model.Styles.StyleDefinition style = new Telerik.WinForms.Documents.Model.Styles.StyleDefinition("test", Telerik.WinForms.Documents.Model.Styles.StyleType.Character); style.SpanProperties.ForeColor = Color.FromArgb(5,99,193); this.radRichTextEditor1.Document.StyleRepository.Add(style);
How to reproduce: private void radButton1_Click(object sender, EventArgs e) { RadPrintDocument doc = new RadPrintDocument(); doc.Margins = new Margins(0, 0, 10, 10); doc.AssociatedObject = this.radRichTextEditor1; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = doc; dialog.ShowDialog(); } Workaround: apply the margins on the document loaded in the editor private void radButton1_Click(object sender, EventArgs e) { RadPrintDocument doc = new RadPrintDocument(); this.radRichTextEditor1.Document.SectionDefaultPageMargin = new Telerik.WinForms.Documents.Layout.Padding(0, 0, 10, 10); doc.AssociatedObject = this.radRichTextEditor1; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = doc; dialog.ShowDialog(); }
The attached video shows how you can reproduce this.
Local properties are not exported to HTML when style is applied over document element (paragraphs, spans, tables) in case the HtmlExportSettings.StyleExportMode is set to Inline. To reproduce: - Add two hyperlinks with differents font and font weights. - Export them with the following code: private void button1_Click(object sender, EventArgs e) { HtmlFormatProvider html_provider = default(HtmlFormatProvider); string htmlBody = null; html_provider = new HtmlFormatProvider(); html_provider.ExportSettings.StylesExportMode = StylesExportMode.Inline; html_provider.ExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.ExportStylesAsCssClasses; htmlBody = html_provider.Export(radRichTextEditor1.Document); File.WriteAllText("test.html", htmlBody); } - Open the file and you will notice that the custom styles are not exported (the links are having the same style). Workaround: html_provider.ExportSettings.StylesExportMode = StylesExportMode.Classes;
InvalidOperationException is thrown in the IsInNonEditableRange() method of RadDocument when assigning a document to RadRichTextBox, which is created through the model and contains several read-only ranges. Workaround: Call MeasureAndArrangeInDefaulSize().
If there is sequence with more than one font info which is not declared in a separate group, they all are concatenated and recorded in the imported fonts as a single one with id from the last one. Here is such a problematic font table group: {\\fonttbl\\f0\\froman\\fcharset0 Times New Roman;\\f1\\froman\\fcharset0 Times New Roman;\\f2\\froman\\fcharset0 Times New Roman;\\f3\\froman\\fcharset0 Times New Roman;\\f4\\froman\\fcharset0 Times New Roman;\\f5\\froman\\fcharset0 Times New Roman;}
When ignoring incorrect words through the Spelling dialog and you reach the last word in the document which is incorrect, only one more word from the beginning of the document is checked prior showing a message that the check is complete. Instead, all incorrect words starting from the beginning of the document should be spellchecked. The issue is reproduced when adding the incorrect words to the dictionary. In order to reproduce the issue, only "Ignore" or "Add to Dictionary" action should be applied. When the actions are mixed, the issue is not reproduced. Workaround: before opening the spellchecking dialog, move caret in the beginning of the document this.radRichTextEditor1.Document.CaretPosition.MoveToFirstPositionInDocument();
Workaround: explicitly set the font size of the spans in the heading paragraphs foreach (Section section in this.radRichTextEditor1.Document.Sections) { foreach (Block block in section.Blocks) { Paragraph p = block as Paragraph; if (p != null && p.StyleName == "Heading1") { foreach (var item in p.Inlines) { Span s = item as Span; if (s!= null) { s.FontSize = p.FontSize; } } } } }
- There should be a formatting symbol for the character - Pressing Ctrl+Shift+Space should insert the character (standard MS Word shortcut) - Import from docx should be implemented - The symbol should be treated as a separator between words when spell-checking