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.
How to reproduce: 1. Run the Mail Merge example (QSF) 2. Select the image inside the document and move it to another position
Use the code below.
1. Click the first button to insert a link.
2. Click inside the link to move the cursor.
3. Click the second button to insert the yellow rectangle
4. Click the third button to export the HTML content.
Actual result: StackOverflow exception occurs
private void radButton1_Click(object sender, EventArgs e)
{
HyperlinkInfo info = new HyperlinkInfo()
{
NavigateUri = "http://www.google.com",
Target = HyperlinkTargets.Blank,
IsAnchor = false
};
this.radRichTextEditor1.InsertHyperlink(info, "www.google.com");
}
private void radButton2_Click(object sender, EventArgs e)
{
LightVisualElement button = new LightVisualElement();
button.Text = "My Button";
button.DrawFill = true;
button.BackColor = System.Drawing.Color.Yellow;
button.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
Section section = new Section();
Paragraph paragraph = new Paragraph();
InlineUIContainer container = new InlineUIContainer();
RadElementUIContainer radContainer = new RadElementUIContainer(button);
container.UiElement = radContainer;
container.Height = 25;
container.Width = 70;
paragraph.Inlines.Add(container);
section.Blocks.Add(paragraph);
RadDocument doc = new RadDocument();
doc.Sections.Add(section);
radRichTextEditor1.InsertFragment(new DocumentFragment(doc));
}
private void radButton3_Click(object sender, EventArgs e)
{
Telerik.WinForms.Documents.Model.RadDocument document = radRichTextEditor1.Document;
Telerik.WinForms.Documents.FormatProviders.Html.HtmlFormatProvider provider = new Telerik.WinForms.Documents.FormatProviders.Html.HtmlFormatProvider();
provider.ExportSettings.InlineUIContainerExporting += ExportSettings_InlineUIContainerExporting;
provider.ExportSettings.DocumentExportLevel = Telerik.WinForms.Documents.FormatProviders.Html.DocumentExportLevel.Fragment;
provider.ExportSettings.ExportFontStylesAsTags = true;
provider.ExportSettings.SpanExportMode = Telerik.WinForms.Documents.FormatProviders.Html.SpanExportMode.DefaultBehavior;
string htmlValue = provider.Export(document);
webBrowser1.DocumentText = htmlValue;
}
private void ExportSettings_InlineUIContainerExporting(object sender, Telerik.WinForms.Documents.FormatProviders.Html.InlineUIContainerExportingEventArgs e)
{
}
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 following parts are with hard coded strings and cannot be localized: - Insert Caption (InsertCaptionDialog): Combo boxes for label and separator - Paragraph Properties (ParagraphPropertiesDialog): Units of spacing and indentation values (pt) - Tab Stops Properties (TabStopsPropertiesDialog): The text of the tabStopsToBeClearedTextBloc - Cross references: reference types Figure and Table - TOC and TOF: Heading and Figure, Caption labels - Document Ruler: Tooltips - FormattingColorPicker: The "No Color" string - ManageStylesDialog shows items "Modify" and "Delete" with hardcoded text.
To reproduce: - insert a fragmet from another RichtextEditor like this: private void Button_Click(object sender, RoutedEventArgs e) { radRichTextBox.Document.Sections.Clear(); radRichTextBox.Document.Sections.Add(new Section()); radRichTextBox.Document.CaretPosition.MoveToLastPositionInDocument(); radRichTextBox.DocumentEditor.InsertParagraph(); radRichTextBox.DocumentEditor.InsertFragment(new DocumentFragment(radRichTextEditor1.Document)); radRichTextBox.DocumentEditor.InsertParagraph(); } Workaround: There is no point of resetting the section in such way. Nevertheless, you can avoid the exception by using one of the following methods: radRichTextBox.Document.MeasureAndArrangeInDefaultSize(); radRichTextBox.UpdateEditorLayout();
To reproduce: - Add two tabs in a PageView - Add RadRichTextEditor in the second tab - Select some text to show the mini toolbar - Select the first page. Workaround void radPageView1_SelectedPageChanged(object sender, EventArgs e) { if (radPageViewPage2.IsContentVisible == false) { radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar.Hide(); } }
Import the following code: <ol> <li>Coffee</li> <li></li> <li>Milk</li> </ol
To reproduce: add some text to RadRichTextEditor and set the Enabled property to false. You will notice that the text gets bold and blurry. Workaround: instead of disabling RadRichTextEditor, use the ReadOnly property.
How to reproduce: check the attached video
Workaround: load an empty docx document in the RadRichTextEditor and use it as a template public RadDocument ImportDocx() { RadDocument document = null; IDocumentFormatProvider provider = new DocxFormatProvider(); OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Filter = "Documents|*.docx"; openDialog.Multiselect = false; DialogResult dialogResult = openDialog.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { using (Stream stream = openDialog.OpenFile()) { document = provider.Import(stream); } } return document; }
Add only a RichTextEditorRibbonBar without any other control on the form. If you run the application you will notice that it loads more than one second. We should investigate if it is possible and how to improve the initialization time.
Hi Sir,
We updated telerik and facing some issues with that.
in new update with rich text editor has new property called MentionBox settings of that auto added in to designer code.
which creates an error when we run the application.
following line is auto added.
mentionBox1.FocusedItemIndex = -1;
we have to comment every time after doing UI changes. and we need to check every time whether that line is commented or not.
Please Help Us.
Thanks,
Ashish.
The issue only reproduces on Windows 10( 1806). Check the attached video showing the result: Workaround: Handle the CommandExecuting event this way private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is ChangeFontFamilyCommand && e.CommandParameter.ToString() == "") { e.Cancel = true; } }
If you import a rtf document, it produces a span instances with highlight color property set to ARGB(255,0,0,0). Workaround: foreach (Span span in document.EnumerateChildrenOfType<Span>()) { if (span.HighlightColor == Color.FromArgb(255, 0, 0, 0)) { span.HighlightColor = Color.Transparent; } }