Workaround use the following code to programatically toggle the spell check mode: RadRibbonBarGroup spellCheckGroup = ((RibbonTab)richTextEditorRibbonBar1.CommandTabs[0]).Items[3] as RadRibbonBarGroup; RadToggleButtonElement toggleButton = spellCheckGroup.Items[1] as RadToggleButtonElement; if (this.radRichTextEditor1.IsSpellCheckingEnabled) { toggleButton.CheckState = CheckState.Unchecked; } else { toggleButton.CheckState = CheckState.Checked; }
Hello Telerik, your control changed the format to Verdana when import rtf. But only in the first line. And only the first line is Arial. Is the first line with any other font formated, its all ok. Here the code: string rtfText = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset0 Tahoma;}{\f2\fnil\fcharset0 Times New Roman;}{\f3\fnil\fcharset0 Arial Unicode MS;}{\f4\fnil\fcharset0 Calibri;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\tx300\tx600\tx900\tx1200\tx1500\tx1800\tx2100\tx2400\tx2700\tx3000\tx3300\tx3600\tx3900\tx4200\tx4500\cf1\b\fs32 Arial\f1\par Tahoma\par \f2 Times New Roman\par \f0 Arial\f2\par \f3 Arial Unicode MS\par \f4 Calibri\b0\f0\fs20\par }"; RtfFormatProvider rtf = new RtfFormatProvider(); this.radRichTextEditor1.Document = rtf.Import(rtfText); this.richTextBox1.Rtf = rtfText; In the screenshot you can see, left the standard .net rtf control and rigth the Telerik richtexteditor. The zip is the sample project.
The "Style" gallery is reinitialized each time the AssociatedRichTextEditor is changed.
To reproduce: - Add RichTextEditorRuler and RichTextEditor to a form. - Add some tab stops in the ruler and press the tab key. Workaround: void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is IncrementParagraphLeftIndentCommand) { e.Cancel = true; TabForwardCommand tabForward = new TabForwardCommand(this.radRichTextEditor1.RichTextBoxElement); tabForward.Execute(); } }
To reproduce: - Add several RadRichTextEditors to a form. - Change the icon of the FontPropertiesDialog. - Close the form and force the garbage collector. Workaround: protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); foreach (var item in this.Controls) { var rte = item as RadRichTextEditor; if (rte != null) { ((FontPropertiesDialog)rte.RichTextBoxElement.FontPropertiesDialog).Dispose(); } } }
To reproduce: - Add some text so the scrollbars appear. - Scroll up and down with the mouse wheel. - When you scroll to the bottom you will notice that there is extra space after the document end. Workaround: http://www.telerik.com/forums/backspace-key-does-not-properly-invalidate-editor#sP5qkJX4b0S8jwZ3MUGTmQ
When the RadRichTExtEditor.Document is rapidly changed not all memory is released Workaround: Point loc = radRichTextEditor1.Location; Size size = radRichTextEditor1.Size; radRichTextEditor1.Dispose(); radRichTextEditor1 = new RadRichTextEditor(); radRichTextEditor1.Location = loc; radRichTextEditor1.Size = size; this.Controls.Add(radRichTextEditor1);
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; } } } } }
The LocalizeStrings method of the FloatingBlockPropertiesDialog refers to the "Documents_FindReplaceDialog_ReplaceWith" string. This should be "Documents_FloatingBlockPropertiesDialog_TextWrapping" Workaround: public Form1() { InitializeComponent(); FieldInfo fi = this.radRichTextEditor1.RichTextBoxElement.FloatingBlockPropertiesDialog.GetType().GetField("radPageViewPage2", BindingFlags.NonPublic | BindingFlags.Instance); RadPageViewPage textWrappingPage = (RadPageViewPage)fi.GetValue(this.radRichTextEditor1.RichTextBoxElement.FloatingBlockPropertiesDialog); textWrappingPage.Text = "TextWrapping"; }
To reproduce: Seth the default font like this: radRichTextEditor1.Document.StyleRepository[RadDocumentDefaultStyles.NormalStyleName].SpanProperties.FontFamily = new Telerik.WinControls.RichTextEditor.UI.FontFamily("Segoe Script"); radRichTextEditor1.RichTextBoxElement.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Segoe Script")); radRichTextEditor1.RichTextBoxElement.ChangeFontSize(Unit.PointToDip(12)); radRichTextEditor1.RichTextBoxElement.ChangeFontStyle(Telerik.WinControls.RichTextEditor.UI.FontStyles.Italic); radRichTextEditor1.RichTextBoxElement.ChangeFontWeight(Telerik.WinControls.RichTextEditor.UI.FontWeights.Bold); Start the application and insert header footer and endnotes.
To reproduce: - Add RichTextEditorRibbonBar to a form and open it upon button click several times. - You will notice that the memory is constantly increasing. Workaround: protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } FieldInfo f1 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableStyle", BindingFlags.NonPublic| BindingFlags.Instance); RichTextEditorRibbonTab tab1 = f1.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab; tab1.Dispose(); FieldInfo f2 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableLayout", BindingFlags.NonPublic | BindingFlags.Instance); RichTextEditorRibbonTab tab2 = f2.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab; tab2.Dispose(); FieldInfo f3 = this.richTextEditorRibbonBar1.GetType().GetField("tabHeaderFooter", BindingFlags.NonPublic | BindingFlags.Instance); RichTextEditorRibbonTab tab3 = f3.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab; tab3.Dispose(); base.Dispose(disposing); }
Implement support for content controls (a.k.a. Structured document tags), which will allow inserting editing controls in the document: - Rich Text - Plain Text - Check Box - Combo Box - Drop-down list - Date picker
To reproduce: - Start the demo application - Type some text and try to make it bold with the bold button from the ribbon. Workaround: void richTextEditorRibbonBar1_MouseDown(object sender, MouseEventArgs e) { radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar.Hide(); }
If you populate the document with more than one section as shown below: Section Section1 = radRichTextEditor.Document.Sections(0); Paragraph Paragraph1 = new Paragraph(); Span Span1 = new Span("Thank you for choosing Telerik"); Section1.Blocks.Add(Paragraph1); Section Section2 = new Section(); Paragraph Paragraph2 = new Paragraph(); Paragraph2.Inlines.Add(image); Section2.Blocks.Add(Paragraph2); radRichTextEditor..Document.Sections.Add(Section2); then mark as selected the space after the first span, then try to type a character, a NullReferenceException will be thrown. WORKAROUND: class MyInputBehavior : RichTextEditor.RichTextEditorInputBehavior { public MyInputBehavior(RadRichTextBox editor) : base(editor) { } public override void InsertText(string text) { if (this.RichTextBox.IsReadOnly) { return; } Telerik.WinForms.Documents.UI.CaretTextInputHandler handler = null; DocumentPrintLayoutPresenter printLayout = this.RichTextBox.ActiveEditorPresenter as DocumentPrintLayoutPresenter; if (printLayout != null) { DocumentPagePresenter pagePresenter = printLayout.GetFocusedPresenter(); if (pagePresenter == null) { pagePresenter = ((Canvas)printLayout.Content).Children[0] as DocumentPagePresenter; } handler = pagePresenter != null ? pagePresenter.CaretTextInputHandler : null; } DocumentWebLayoutPresenter webLayout = this.RichTextBox.ActiveEditorPresenter as DocumentWebLayoutPresenter; if (webLayout != null) { handler = webLayout.CaretTextInputHandler; } if (handler != null) { handler.HandleTextInsertedWithoutIme(this.RichTextBox.ActiveEditor.Document, text); } } } radRichTextEditor.InputHandler = New MyInputBehavior(radRichTextEditor.RichTextBoxElement)
To reproduce Write a word in an RightToLeft language and then type "." You will notice that the dot is moved to the end of the word.