This is a migrated thread and some comments may be shown as answers.

Removing the default "untitled" title

1 Answer 89 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 17 Mar 2020, 03:42 PM

Hello-

Using the RichTextEditor and retrieving [ MyRichTextControl.GetContent("HTML") ] from it using any text at all, the "title" of that property contains "Untitled".

Here's the exact return value: <title>Untitled</title>

Is there a simple way to not include a "title" by default, or null/blank it out ?

Thanks in advance -B

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Mar 2020, 06:55 AM

Hello, William,  

The RadRichTextEditor.GetContent("HTML") method internally uses the HtmlFormatProvider.

HtmlFormatProvider allows for import of HTML documents and respectively export of RadRichTextEditor to HTML. Additionally, the import/export settings provide modification options. HtmlFormatProvider exposes ExportSettings, which allow you to control the export of the RadRichTextEditor document. Thus, you can specify the HtmlExportSettings.Title property to an empty string for example and the "Untitled" value won't be exported. 

            HtmlExportSettings htmlExportSettings = new HtmlExportSettings();
            RadDocument document = this.radRichTextEditor1.Document;
            HtmlFormatProvider provider = new HtmlFormatProvider();
            htmlExportSettings.Title = ""; 
            provider.ExportSettings = htmlExportSettings;
            string html = provider.Export(document);

It is not possible to ignore storing this title in the header. You can either specify its content as it is demonstrated above or just remove the specific text from the HTML content.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RichTextEditor
Asked by
William
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or