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)
{
}
Import the following code: <ol> <li>Coffee</li> <li></li> <li>Milk</li> </ol
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(); } }
Workaround: public class MyInputBehavior : InputBehavior { public MyInputBehavior(DocumentView view) : base(view) { } public override bool ProcessKeyPress(System.Windows.Forms.KeyPressEventArgs e) { // TO DO: You code here e.KeyChar = char.ToUpper(e.KeyChar); return true; // By commenting the base call you are supresing the default logic //return base.ProcessKeyPress(e); } } Then you should replace the default input behavior by using the following code snippet: this.richTextBox.DocumentView.InputBehavior = new MyInputBehavior(this.richTextBox.DocumentView);
RadRichTextBox large txt documents (20000 rows)are loaded very slowly.
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: private void radButton1_Click(object sender, EventArgs e) { RadPrintDocument doc = new RadPrintDocument(); doc.Margins = new Margins(0, 0, 10, 10); doc.AssociatedObject = this.radRichTextEditor1; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = doc; dialog.ShowDialog(); } Workaround: apply the margins on the document loaded in the editor private void radButton1_Click(object sender, EventArgs e) { RadPrintDocument doc = new RadPrintDocument(); this.radRichTextEditor1.Document.SectionDefaultPageMargin = new Telerik.WinForms.Documents.Layout.Padding(0, 0, 10, 10); doc.AssociatedObject = this.radRichTextEditor1; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = doc; dialog.ShowDialog(); }
When you have more than one RadRichTextEditor controls on the form and you have selected text in both of theme, only the focused RadRichTextEditor should show the selection.
How to reproduce: create a table with 1px of the inner borders and 3px of the outer borders. The attached screenshots demonstrates the issue. A similar result can be also observed with other widths as well.
When CJK text (Chinese, Korean, Japanes) is copied from WordPad and paste into RadRichTextBox text, the characters are imported incorrectly (as '?' and as different characters). The same applies if WordPad document containing CJK is imported from RTF. The problem is related to the specified \fcharset134 RTF tag, which is not properly interpreted.