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.
Workaround:
string match = "www.telerik.com";
string text = File.ReadAllText("..\\..\\test.html");
text = text.Replace(match, "http://" + match);
File.WriteAllText("..\\..\\test.html", text);
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.
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 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;
}
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;
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.
To reproduce: Import a document which contains square brackets and fields (the document must use right to left language).
Please refer to the attached files.
The "Style" gallery is reinitialized each time the AssociatedRichTextEditor is changed.
To reproduce:
- Associate the ribbon with the RichtextEditor
- Subscribe to the DocumentContentChanged and start the application.
- The event is fired because the ribbon is making changes to the document.
Workaround:
void Form1_Shown(object sender, EventArgs e)
{
ribbonBar1.AssociatedRichTextEditor = radRichTextEditor1;
}
RadRichTextEditor renders the text with a little bigger characters spacing than RadRichTextBox and MS Word.
Note: this text spacing problem can be observed in other Telerik controls as well.
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