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

Print window contents

1 Answer 279 Views
Window
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 26 Nov 2014, 04:18 PM
I want to print the window contents on window open.  Is there a way to do this?  Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Nov 2014, 11:48 AM
Hello,

In scenarios, in which you want to print a particular container on the page (be it a Window widget or anything else), you have two options:

1. CSS-only solution

Use a print stylesheet and hide everything on the page, except the contents of the Window widget. This contents is inside a <div> element with the Window ID (Name) and a .k-window-content CSS class. This option is viable, if the user will never like to print anything else from the page.

2. Javascript solution

Clone the Window's contents inside a new browser window and print that window. The documentation shows how to do that with the Grid. Your scenario is a lot simpler, so your will need to remove most of the custom CSS and JS code.

http://docs.telerik.com/kendo-ui/web/grid/print-export

Regards,
Dimo
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.

 
Tags
Window
Asked by
M
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or