Note: this problem is related to the following feedback item: http://feedback.telerik.com/Project/154/Feedback/Details/174882-fix-radrichtexteditor-spellcheckingdialog-should-not-be-closed-when-a-misspell You should apply the suggested workaround in order to be able to replicate the problem. Steps to reproduce: 1. Enter some misspelled words. 2. Open the spell checking form by using the context menu. 3. "Ignore" the first misspelled word. 4. The next wrong word is highlighted. If you add it to the dictionary, the previously ignored word is highlighted as well. Workaround: use the "Ignore All" option.
How to reproduce: public Form1() { InitializeComponent(); richTextEditorRibbonBar1.AssociatedRichTextEditor = radRichTextEditor1; radRichTextEditor1.Insert("This is a example for the \"ContextMenu shows up even when disabled\" error. If you right click on a word nothing happens (just as it is supposed to be) now klick \"Find Next Error\" and there it is (not supposed to be)\n\nlkjds klsdjfio jlk sdjfi lsdifuioew rlsoidf sjdiuf oipds jifpodsuf "); radRichTextEditor1.IsContextMenuEnabled = false; } private void dropdown_PopupOpening(object sender, CancelEventArgs args) { args.Cancel = true; } Workaround: public Form1() { InitializeComponent(); richTextEditorRibbonBar1.AssociatedRichTextEditor = radRichTextEditor1; radRichTextEditor1.Insert("This is a example for the \"ContextMenu shows up even when disabled\" error. If you right click on a word nothing happens (just as it is supposed to be) now klick \"Find Next Error\" and there it is (not supposed to be)\n\nlkjds klsdjfio jlk sdjfi lsdifuioew rlsoidf sjdiuf oipds jifpodsuf "); radRichTextEditor1.IsContextMenuEnabled = false; FieldInfo fi = this.radRichTextEditor1.RichTextBoxElement.ContextMenu.GetType().GetField("radDropDownMenu", BindingFlags.Instance | BindingFlags.NonPublic); RadDropDownMenu dropdown = fi.GetValue(this.radRichTextEditor1.RichTextBoxElement.ContextMenu) as RadDropDownMenu; if (dropdown != null) { dropdown.PopupOpening += dropdown_PopupOpening; } } private void dropdown_PopupOpening(object sender, CancelEventArgs args) { args.Cancel = true; }
Note: it should be closed automatically when all words are corrected. To reproduce: 1. Enter some misspelled words and open the context menu with right mouse click. 2. Show the SpellCheckingDialog. 3. Add a word to the dictionary. The SpellCheckingDialog will be closed immediately. However, if you press to ignore the word/words, the dialog remains opened. Workaround: cancel the SpellCheckingDialog.FormClosing event except when the close button is clicked: public Form1() { InitializeComponent(); this.radRichTextEditor1.IsSpellCheckingEnabled = true; RadButton buttonClose = ((SpellCheckingDialog)this.radRichTextEditor1.RichTextBoxElement.SpellCheckingDialog).Controls["buttonClose"] as RadButton; buttonClose.MouseDown += buttonClose_MouseDown; ((SpellCheckingDialog)this.radRichTextEditor1.RichTextBoxElement.SpellCheckingDialog).FormClosing += SpellCheckingDialog_FormClosing; } bool shouldClose = false; private void buttonClose_MouseDown(object sender, MouseEventArgs e) { shouldClose = true; } private void SpellCheckingDialog_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason != CloseReason.FormOwnerClosing) { e.Cancel = !shouldClose; shouldClose = false; } }
To reproduce: - Write some text. - Change the current user. - Repeat three or four times. - Open spellchecking dialog.
Workaround: handle the CommandExecuted event and manually adjust the location of these forms public Form1() { InitializeComponent(); this.radRichTextEditor1.CommandExecuted += radRichTextEditor1_CommandExecuted; } private void radRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e) { if (e.Command is ShowInsertSymbolWindowCommand) { ((InsertSymbolDialog)this.radRichTextEditor1.RichTextBoxElement.InsertSymbolWindow).Location = Screen.FromControl(this).WorkingArea.Location; } else if (e.Command is ShowFindReplaceDialogCommand) { ((FindReplaceDialog)this.radRichTextEditor1.RichTextBoxElement.FindReplaceDialog).Location = Screen.FromControl(this).WorkingArea.Location; } }
If I drag&drop a RadRichTextEditor i want a wizard like the RichTextBox-WPF-Control. I don't like the ribbon style, because I need a compact editor. So I like the CommandBarStrip look of the "command bar ui"-demo or the ASP.NET Editor.
Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.AdjustPaddings(0); this.AdjustPaddings(3); } private void AdjustPaddings(int index) { RibbonTab tab = ((RibbonTab)this.richTextEditorRibbonBar1.CommandTabs[0]); RadRibbonBarGroup group = (RadRibbonBarGroup)tab.Items[index]; foreach (RadElement el in group.Items) { el.Padding = new Padding(3, 1, 3, 1); } } }
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);
Workaround: private void radRichTextEditor1_CommentShowing(object sender, Telerik.WinForms.Documents.UI.CommentShowingEventArgs e) { this.radRichTextEditor1.RichTextBoxElement.ContextMenu.Opened-=ContextMenu_Opened; this.radRichTextEditor1.RichTextBoxElement.ContextMenu.Opened+=ContextMenu_Opened; } private void ContextMenu_Opened(object sender, Telerik.WinForms.Documents.UI.Extensibility.ContextMenuPlacementEventArgs e) { this.radRichTextEditor1.RichTextBoxElement.ContextMenu.Hide(); }
Workaround: private void radRichTextEditor1_CommentShowing(object sender, Telerik.WinForms.Documents.UI.CommentShowingEventArgs e) { ((SelectionMiniToolBar) this.radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar).Shown+=Form1_Shown; } private void Form1_Shown(object sender, EventArgs e) { ((SelectionMiniToolBar)sender).Visible = false; ((SelectionMiniToolBar)sender).VisibleChanged+=Form1_VisibleChanged; } private void Form1_VisibleChanged(object sender, EventArgs e) { ((SelectionMiniToolBar)sender).Visible = false; }
In some cases where you have RTL word and a number, the word order is different than the order displayed in MS Word (see attached doc). This might be related to the applied styles, because if you apply normal style, the order will be the same as in RadRichTextEditor.
Workaround: specify the users' dictionary with colors when the user is changed. private void radRichTextEditor1_UserInfoChanged(object sender, EventArgs e) { FieldInfo fi = typeof(TrackChangesOptions).GetField("userToColorMap", BindingFlags.Instance | BindingFlags.NonPublic) ; Dictionary<string, Telerik.WinControls.RichTextEditor.UI.Color> userToColorMap = fi.GetValue(radRichTextEditor1.RichTextBoxElement.TrackChangesOptions) as Dictionary<string, Telerik.WinControls.RichTextEditor.UI.Color>; userToColorMap = new Dictionary<string, Telerik.WinControls.RichTextEditor.UI.Color>(); userToColorMap.Add("Boby1", Telerik.WinControls.RichTextEditor.UI.Color.FromRgb(0, 255, 255)); userToColorMap.Add("Boby2", Telerik.WinControls.RichTextEditor.UI.Color.FromRgb(255, 0, 255)); fi.SetValue(radRichTextEditor1.RichTextBoxElement.TrackChangesOptions, userToColorMap); }
To reproduce: 1. Install a font that is not part of the default ones. 2. Enter some text in RadRichTextEditor and use the installed font. 3. Export to pdf. 4. Uninstall the font. 5. Try to open the exported pdf. You will notice that the font is not embedded into the file and can not render the text correctly. Please refer to the attached sample pdf file with custom font.
To reproduce: - Use the cut option in the context menu then dispose the rich text editor and collect the garbage. Workaround: Telerik.WinControls.RichTextEditor.UI.ContextMenu menu = textEditor.RichTextBoxElement.ContextMenu as Telerik.WinControls.RichTextEditor.UI.ContextMenu; textEditor.RichTextBoxElement.ContextMenu = null; RadDropDownMenu ddm = menu.GetType().GetField("radDropDownMenu", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(menu) as RadDropDownMenu;
Workaround: set the FormBorderStyle property to FixedSingle for the respective dialog. RadForm f = this.radRichTextEditor1.RichTextBoxElement.FontPropertiesDialog as RadForm; f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
To reproduce: use the following code snippet and refer to the attached screenshot. Cells' width should be identical in both of the cases. RadDocument document = new RadDocument(); Section section = new Section(); Table t = new Table(); t.Borders = new TableBorders(new Border(2, Telerik.WinForms.Documents.Model.BorderStyle.Single, Color.Black)); TableRow r1 = new TableRow(); TableCell cell = new TableCell(); Paragraph p = new Paragraph(); Span s = new Span(); s.Text = "Header"; cell.ColumnSpan = 3; p.Inlines.Add(s); cell.Blocks.Add(p); cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 100); r1.Cells.Add(cell); TableRow r2 = new TableRow(); TableCell cell11 = new TableCell(); Paragraph p11 = new Paragraph(); Span s11 = new Span(); s11.Text = "Cell1,1"; p11.Inlines.Add(s11); cell11.Blocks.Add(p11); cell11.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 40); TableCell cell12 = new TableCell(); Paragraph p12 = new Paragraph(); Span s12 = new Span(); s12.Text = "Cell1,2"; p12.Inlines.Add(s12); cell12.Blocks.Add(p12); cell12.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 10); TableCell cell13 = new TableCell(); Paragraph p13 = new Paragraph(); Span s13 = new Span(); s13.Text = "Cell1,3"; p13.Inlines.Add(s13); cell13.Blocks.Add(p13); cell13.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 50); r2.Cells.Add(cell11); r2.Cells.Add(cell12); r2.Cells.Add(cell13); t.Rows.Add(r1); t.Rows.Add(r2); section.Blocks.Add(t); document.Sections.Add(section); this.radRichTextEditor1.Document = document; Workaround: do not specify the PreferredWidth proeprty for cells with ColumnSpan>1
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;