The PreviewEditorKeyDown event is not fired when the user is typing in the editor. Workaround Create custom input behaviour: www.telerik.com/help/winforms/richtexteditor-keyboard-support.html
Copy the following image from the browser and paste it to RadRichTextEditor: https://en.wikipedia.org/wiki/File:Telerik_Logo.png. IOException is thrown when pasting the image. However, it is loaded at the end. Export the image with the following code: private void radButton1_Click(object sender, EventArgs e) { DocumentFormatProviderBase provider = new XamlFormatProvider(); byte[] byteData = provider.Export(this.radRichTextEditor1.Document); } ArgumentException occurs. Workaround: save the image first and copy it from Paint for example.
To reproduce: public Form1() { InitializeComponent(); this.radRichTextEditor1.IsReadOnly = true; } Workaround: private void Form1_Load(object sender, EventArgs e) { this.radRichTextEditor1.IsReadOnly = true; Telerik.WinControls.RichTextEditor.UI.DocumentWebLayoutPresenter webLayoutPresenter = this.radRichTextEditor1.RichTextBoxElement.ActiveEditorPresenter as Telerik.WinControls.RichTextEditor.UI.DocumentWebLayoutPresenter; webLayoutPresenter.Caret.Width = 0; }
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(); }
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: use the code snippet below. Please refer to the attached screenshot. public Form1() { RichTextBoxLocalizationProvider.CurrentProvider = new MyRichTextBoxLocalizationProvider(); InitializeComponent(); } public class MyRichTextBoxLocalizationProvider : RichTextBoxLocalizationProvider { public override string GetLocalizedString(string id) { return base.GetLocalizedString(id); } } Workaround: Modify the XML file containing all the strings RichTextBoxLocalizationProvider.CurrentProvider = RichTextBoxLocalizationProvider.FromFile(@"C:\RichTextBoxStrings.xml");. You can download a XML file that contains all the currently used strings from here: http://www.telerik.com/docs/default-source/ui-for-winforms/richtextboxstrings.zip?sfvrsn=2
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);
Would it be possible to make the Font Section dropdown editable on the RabRibbonBar? i.e. It would be nice to be able to enter the character "s" for example and see all fonts starting with S. Currently you must scroll. Thanks, Ronny
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; }
Due to a namespace conflict, projects which reference Telerik.WinControls.RichTextBox.dll and target .NET 4.5 or above, cannot be built successfully if they are using some of the conflicting types. The conflict comes from the ICommand interface (https://msdn.microsoft.com/en-us/library/system.windows.input.icommand%28v=vs.110%29.aspx) which was moved from PresentationCore.dll to System.dll in .NET 4.5.
The "Style" gallery is reinitialized each time the AssociatedRichTextEditor is changed.
To reproduce: Import the following rtf: 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;
If you insert an InlineUIContainer with a RadTextBoxElement, you should be able to export its content when exporting the whole document.
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
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 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); }
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)