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

Possible Bug with PrintPreview

1 Answer 47 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 02 Feb 2017, 03:24 PM

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()

1 Answer, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 07 Feb 2017, 08:08 AM
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.
Tags
RichTextEditor
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Share this question
or