4 Answers, 1 is accepted
0

Maurizio
Top achievements
Rank 2
answered on 29 Oct 2014, 12:14 PM
I found it out myself:
MyRadRichTextBox.Document.Selection.SelectAll();
MyRadRichTextBox.Document.Delete(false);
Why is it so difficult to find such things in the Telerik documentation? MS Docu is much better...
MyRadRichTextBox.Document.Selection.SelectAll();
MyRadRichTextBox.Document.Delete(false);
Why is it so difficult to find such things in the Telerik documentation? MS Docu is much better...
0
Hello Peter,
Thank you for your feedback, it is much appreciated. We will consider the suggestion in the future improvements of our documentation.
Please also note that while executing this code will clear the contents of the editor, the RadDocument instance preserves many other properties such as styles, document variables, history of the previously executed actions, properties of the first section, etc. That being said, you might not achieve exactly the desired result.
Let us know if any additional questions arise.
Regards,
Petya
Telerik
Thank you for your feedback, it is much appreciated. We will consider the suggestion in the future improvements of our documentation.
Please also note that while executing this code will clear the contents of the editor, the RadDocument instance preserves many other properties such as styles, document variables, history of the previously executed actions, properties of the first section, etc. That being said, you might not achieve exactly the desired result.
Let us know if any additional questions arise.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0

Steve
Top achievements
Rank 1
answered on 06 Jun 2019, 10:46 PM
Is there an answer to the question on how to clear the rich text box properly?
0
Hi Steve,
The proper approach is the one Maurizio posted on 29 Oct - to select all the content and then invoke the Delete() method. However, the method exposed by RadDocument is now obsolete and we recommend using the API of RadRichTextBox or RadDocumentEditor:
Regards,
Tanya
Progress Telerik
The proper approach is the one Maurizio posted on 29 Oct - to select all the content and then invoke the Delete() method. However, the method exposed by RadDocument is now obsolete and we recommend using the API of RadRichTextBox or RadDocumentEditor:
this
.radRichTextBox.Document.Selection.SelectAll();
this
.radRichTextBox.Delete(
true
);
Regards,
Tanya
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.