Possible Bug with PrintPreview

2 posts, 0 answers
  1. Jason Parrish
    Jason Parrish avatar
    92 posts
    Member since:
    Sep 2009

    Posted 02 Feb 2017 Link to this post

    I have a need of hiding the richtexteditor, populating it, and then doing a PrintPreview.  I have discovered that if the control's "Visible" property is false, it does not work. The document is empty.  It also does not work if you dynamically create the control at run-time. Thoughts?  Obviously, I can add a control to the form and hide it behind another control, but that's a hack.

     

    Dim foo As New RadRichTextEditor
    Dim provider As New HtmlFormatProvider()
     
    foo.Document = provider.Import("<html><body>All Notes for Project Foo<br/><br/></body></html>")
    foo.PrintPreview()
  2. Ralitsa
    Admin
    Ralitsa avatar
    190 posts

    Posted 07 Feb 2017 Link to this post

    Hi Jason,

    Thank you fo contacting us. 

    The observed behavior is not an issue with PrintPreview. You need to call the LoadElementTree method, so it will force loading RadRichTextEditor`s elements. Please refers to the code snippet below how to achieve it: 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim foo As New RadRichTextEditor()
        foo.LoadElementTree()
        Dim provider As New HtmlFormatProvider()
        foo.Document = provider.Import("<html><body>All Notes for Project Foo<br/><br/></body></html>")
        foo.PrintPreview()
    End Sub

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Ralitsa
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top