To reproduce: <!DOCTYPE html> <html> <head> <style type="text/css">body { font-family: Segoe UI; } a { color: #5cb85c; } a:hover { color: #000000; }</style> <title>My first HTML document</title> </head> <body> <span style="font-size: 14px; margin-bottom: 5px; display:block;">The Title</span> <ul style="list-style-type:none; padding-left: 0px; margin-left: 0px;"> <li style="margin-left: 0px; padding-left: 0px; font-size: 12px;"> <a href="www.myurl.com">My URL</a> </li> <li style="margin-left: 0px; padding-left: 0px; font-size: 12px;"> <a href="https://www.myurl2.com/">My URL 2</a> </li> </ul> </body> </html>
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; }
Workaround: public partial class Form1 : Form { private Telerik.WinForms.RichTextEditor.RichTextBoxUI.Dialogs.SpellCheckingDialog spellDlg; public Form1() { InitializeComponent(); } private void radButton1_Click(object sender, EventArgs e) { this.spellDlg = new Telerik.WinForms.RichTextEditor.RichTextBoxUI.Dialogs.SpellCheckingDialog(); Telerik.WinForms.Documents.UI.Extensibility.SpellCheckingUIManager manager = new Telerik.WinForms.Documents.UI.Extensibility.SpellCheckingUIManager(this.radRichTextEditor1.RichTextBoxElement); FieldInfo fi = this.spellDlg.GetType().GetField("suggestionsListBox", BindingFlags.NonPublic | BindingFlags.Instance); RadListControl suggestionListBox = fi.GetValue(this.spellDlg) as RadListControl; suggestionListBox.DataBindingComplete -= suggestionListBox_DataBindingComplete; suggestionListBox.DataBindingComplete += suggestionListBox_DataBindingComplete; this.spellDlg.ShowDialog(manager, this.radRichTextEditor1.RichTextBoxElement); } private void suggestionListBox_DataBindingComplete(object sender, ListBindingCompleteEventArgs e) { if (((RadListControl)sender).Items.Count == 0) { FieldInfo fiBtnChange = this.spellDlg.GetType().GetField("buttonChange", BindingFlags.NonPublic | BindingFlags.Instance); RadButton btnChange = fiBtnChange.GetValue(this.spellDlg) as RadButton; btnChange.Enabled = false; FieldInfo fiBtnChangeAll = this.spellDlg.GetType().GetField("buttonChangeAll", BindingFlags.NonPublic | BindingFlags.Instance); RadButton btnChangeAll = fiBtnChangeAll.GetValue(this.spellDlg) as RadButton; btnChangeAll.Enabled = false; } } }
To reproduce: Use the following code and then select some text: private void radButton1_Click(object sender, EventArgs e) { TxtFormatProvider txtProvider = new TxtFormatProvider(); RichTextEditor.Document = txtProvider.Import(sampleText); RichTextEditor.Document.LineSpacingType = LineSpacingType.Exact; RichTextEditor.Document.LineSpacing =10; DocumentPosition startPosition = RichTextEditor.Document.CaretPosition; DocumentPosition endPosition = new DocumentPosition(startPosition); startPosition.MoveToStartOfDocumentElement(RichTextEditor.Document); endPosition.MoveToEndOfDocumentElement(RichTextEditor.Document); RichTextEditor.Document.Selection.Clear(); RichTextEditor.Document.Selection.AddSelectionStart(startPosition); RichTextEditor.Document.Selection.AddSelectionEnd(endPosition); RichTextEditor.RichTextBoxElement.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Segoe UI")); RichTextEditor.RichTextBoxElement.ChangeFontSize(Unit.PointToDip(10)); RichTextEditor.Document.Selection.Clear(); } Workaround: RichTextEditor.Document.LineSpacingType = LineSpacingType.Auto; RichTextEditor.Document.LineSpacing =.5;
To reproduce: - Add RichTextEditorRibbonBar and associate it with RadRichTextEditor at design time. - Show the form and then force the garbage collector. Workaround: - Associate the controls in the load event. - Set the AssociatedRichTextEditor to null just before the form is closed. protected override void OnLoad(EventArgs e) { base.OnLoad(e); richTextEditorRibbonBar1.AssociatedRichTextEditor = radRichTextEditor1; } protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { richTextEditorRibbonBar1.AssociatedRichTextEditor = null; base.OnClosing(e); }
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
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.