Unplanned
Last Updated: 10 Apr 2024 13:53 by Benjamin

This is the used code snippet:

        static void Main(string[] args)
        {
            Telerik.WinForms.Documents.Model.RadDocument templateDocument = GetDocument("Template.rtf");
            Telerik.WinForms.Documents.Model.RadDocument contentDocument = GetDocument("Content.rtf");

            Telerik.WinForms.Documents.Model.Merging.InsertDocumentOptions options = new Telerik.WinForms.Documents.Model.Merging.InsertDocumentOptions();
            options.ConflictingStylesResolutionMode = Telerik.WinForms.Documents.Model.Merging.ConflictingStylesResolutionMode.RenameSourceStyle;
            options.InsertLastParagraphMarker = true;

            Telerik.WinForms.Documents.Model.RadDocumentEditor templateEditor = new Telerik.WinForms.Documents.Model.RadDocumentEditor(templateDocument);
            templateEditor.InsertFragment(new Telerik.WinForms.Documents.Model.DocumentFragment(contentDocument));

    
            string mergedDocumentFilePath = "MergeDocumentsWithRichTextEditor.rtf";
            File.Delete(mergedDocumentFilePath);
            WriteDocToFile(templateDocument, mergedDocumentFilePath);

        }
        private static Telerik.WinForms.Documents.Model.RadDocument GetDocument(string rtfFilePath)
        {
            Telerik.WinForms.Documents.Model.RadDocument document = null;
            var rtfImporter = new Telerik.WinForms.Documents.FormatProviders.Rtf.RtfFormatProvider();
            using (Stream stream = File.OpenRead(rtfFilePath))
            {
                document = rtfImporter.Import(stream);
            }
            return document;
        }


        private static void WriteDocToFile(Telerik.WinForms.Documents.Model.RadDocument doc, string filename)
        {
            var rtfExporter = new Telerik.WinForms.Documents.FormatProviders.Rtf.RtfFormatProvider();
            string rtfText = rtfExporter.Export(doc);
            File.WriteAllText(filename, rtfText);

            Process.Start(filename);
        }

Observed result: 

Expected result: keep the After spacing as it is in the original documents.

Unplanned
Last Updated: 09 Apr 2024 13:38 by ADMIN
Pasting from Excel will add the text to a table. Keep Text Only paste option should ignore the table and paste only the text. 
Unplanned
Last Updated: 05 Apr 2024 08:42 by ADMIN

In the Fluent theme, the Font Size Dropdown of the SelectionMiniToolBar is not wide enough.

Unplanned
Last Updated: 01 Feb 2024 13:55 by ADMIN
The command tabs collection in the RichTextEditorRibbonBar is not intended to be modified design time. The EditCommandTabs option in the smart tag should not be available. This collection is recreated the moment you close and reopen the designer. The same will happen when you run the application. This option should be removed from the smart tag.
Unplanned
Last Updated: 02 Nov 2023 12:58 by ADMIN
Unplanned
Last Updated: 05 Jun 2023 05:33 by ADMIN
Slow performance when importing documents with many hyperlink fields from RTF or Docx
Unplanned
Last Updated: 14 Apr 2023 08:14 by ADMIN
The CurrentEditingStyle is not updated correctly when changing the font of long text.
Declined
Last Updated: 20 Apr 2023 12:54 by ADMIN

Copy some text from the introduction docs page:

Paste in RadRichTextEditor from the Demo app:

 

Completed
Last Updated: 27 Apr 2023 06:55 by ADMIN
Release R2 2023 (LIB 2023.1.427)

Copy some content and paste it in the editor. The PasteOptions dialog remains opened and if the user clicks the PrintPreview button an error occurs:

Stack trace:

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.RichTextEditor.UI.PasteOptionsPopup.OnRichTextBoxLayoutUpdated(Object sender, EventArgs e)
   at Telerik.WinControls.Layouts.ContextLayoutManager.fireLayoutUpdateEvent()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.Telerik.WinForms.RichTextEditor.IDocumentEditorPresenter.UpdateLayout()
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.<>c__DisplayClass653_0.<UpdateEditorLayout>b__0()
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.UpdateEditorLayout(Boolean focusCarret, Boolean updateCaretSize, Boolean async)
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.set_ActiveEditorPresenter(IDocumentEditorPresenter value)
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.Telerik.WinControls.UI.IPrintable.BeginPrint(RadPrintDocument sender, PrintEventArgs args)
   at Telerik.WinControls.UI.RadPrintDocument.OnBeginPrint(PrintEventArgs e)
   at System.Drawing.Printing.PrintDocument._OnBeginPrint(PrintEventArgs e)
   at System.Drawing.Printing.PrintController.Print(PrintDocument document)
   at System.Drawing.Printing.PrintDocument.Print()
   at System.Windows.Forms.PrintPreviewControl.ComputePreview()
   at System.Windows.Forms.PrintPreviewControl.CalculatePageInfo()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

Unplanned
Last Updated: 17 Mar 2023 09:02 by ADMIN

Open the Demo application >> RichTextEditor>> First Look example and open and empty document. Keep a random key pressed. You are expected to observe delayed text input:

Unplanned
Last Updated: 26 Dec 2022 10:29 by ADMIN

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)
        { 
        }

Unplanned
Last Updated: 29 Nov 2022 13:14 by Shaindy
A line pasted from outlook is not exported correctly to HTML.
Unplanned
Last Updated: 25 Nov 2022 09:35 by Timo

If you remove the last span of a paragraph (on a measured document), using the inline collection, a NullReferenceException is thrown.

As a workaround: either make sure the manipulation happens on a non-measured document, or remove the span by using the RichTextEditor's API:

this.radRichTextEditor.Document.Selection.AddDocumentElementToSelection(span);
this.radRichTextEditor.Delete(false);

 

Completed
Last Updated: 02 Feb 2023 09:35 by ADMIN
Release R1 2023
When importing RTF the with specific font the FontSubstituting event is not fired.
Unplanned
Last Updated: 16 Nov 2022 06:12 by Timo
line break after/inside div element is not imported correctly
Completed
Last Updated: 02 Feb 2023 09:35 by ADMIN
Release R1 2023

To reproduce:

this.radRichTextEditor1.Text = null;

Unplanned
Last Updated: 18 Oct 2022 11:59 by ADMIN

Add Korean language to your machine:

Then type 'rkskekfk'. The expected symbols are: "가나다라". However, if you try selecting the entered text, the last symbol disappears:

Unplanned
Last Updated: 07 Sep 2022 15:47 by Hristo
InvalidOperationException: 'ColumnSpan must be at least 1.' is thrown when importing HTML document with table column containing colspan="0".

The colspan="0" has special meaning according to the HTML specification http://www.w3.org/TR/html401/struct/tables.html:
-------------------
colspan = number [CN]

This attribute specifies the number of columns spanned by the current cell. The default value of this attribute is one ("1"). The value zero ("0") means that the cell spans all columns from the current column to the last column of the column group (COLGROUP) in which the cell is defined.
-------------------
Workaround: Preprocess the HTML, and delete all occurrences of colspan="0".
Unplanned
Last Updated: 29 Aug 2022 12:53 by Prashant

When a document is imported from HTML, we set locally to the span elements Times New Roman nevertheless it is not declared anywhere. This breaks the document view if for example we decide to change the RadDocument's default font family or even the NormalWeb style's font. The same applies for the font size as well.

Workaround: Clear the FontFamily property after import

foreach (Span span in this.radRichTextBox.Document.EnumerateChildrenOfType<Span>())
{
    span.GetStyleProperty(Span.FontFamilyProperty).ClearValue();

   span.GetStyleProperty(Span.FontSizeProperty).ClearValue();

}

Steps to reproduce:

1. Import the following html:

this.radRichTextBox.Document = new HtmlFormatProvider().Import(@"<h1>Hello</h1><h2>World</h2><p>Lorem ipsum<p>");

2. Set the document's default font family to Comic Sans MS:

this.radRichTextBox.Document.Style.SpanProperties.FontFamily = new FontFamily("Comic Sans MS");

Observe: The font in the document is Times New Roman

Expected: The font should be Comic Sans MS

Unplanned
Last Updated: 05 Aug 2022 10:35 by ADMIN

When changing the theme through ThemeResolutionService.ApplicationThemeName all the application gets changed. Except the ForeColor of the RadRichTextEditor does not get change. Hence the box displays black text on a dark background. Quite unreadable.

Assigning the theme directly in the designer makes everything renders ok.

Sample application attached.

Regrads,
Matthias

 

1 2 3 4 5 6