How to Clear entire Richtextbox

3 posts, 0 answers
  1. Maurizio
    Maurizio avatar
    43 posts
    Member since:
    Jan 2012

    Posted 29 Oct 2014 Link to this post

    How do I clear the entire Content of a RadRichTextBox?

    For some Reason I don't want to use:

    MyRadRichTextBox.Document = new Telerik.Windows.Documents.Model.RadDocument();
  2. Maurizio
    Maurizio avatar
    43 posts
    Member since:
    Jan 2012

    Posted 29 Oct 2014 Link to this post

    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...
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petya
    Admin
    Petya avatar
    975 posts

    Posted 03 Nov 2014 Link to this post

    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
     

    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.

     
Back to Top