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

New Print Button

6 Answers 495 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 05 May 2016, 03:48 PM

Is there any way top have the new print button create the PDF in landscape?

Thanks

6 Answers, 1 is accepted

Sort by
0
Ken
Top achievements
Rank 1
answered on 05 May 2016, 03:55 PM

Also it seems the button will only show when RenderMode is Lightweight

Is this true?

0
Viktor Tachev
Telerik team
answered on 10 May 2016, 08:48 AM
Hello Ken,

You can configure the page layout in the print dialog options. There you can specify if the page should be printed in landscape or portrait orientation.

As for your second query - indeed the print button is shown when RenderMode is set to Lightweight.



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Ken
Top achievements
Rank 1
answered on 12 May 2016, 06:26 PM

Thanks Viktor that seemed to work well

One more question
when adding the print button to a manually constructed Command Item Line what should it look like. I used the Refresh as a starting point and it did not work... thanks

<telerik:RadButton ID="btnPrint" runat="server" Text="Print " CommandName="PrintGrid">
    <Icon SecondaryIconCssClass="rbPrint"></Icon>
</telerik:RadButton>

 

0
Viktor Tachev
Telerik team
answered on 17 May 2016, 12:29 PM
Hi Ken,

In order to use a custom button for printing the grid you need to ensure that the ClientSettings-EnableClientPrint property is set to true first.

The button itself would look similar to the following:

<CommandItemTemplate >
    <asp:Button Text="Print" runat="server" OnClientClick="clientClick(); return false;" />
</CommandItemTemplate>

and the JavaScript:

function clientClick() {
    var grid = $find("<%= RadGrid1.ClientID %>");
    grid.print();
}


Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Ken
Top achievements
Rank 1
answered on 19 May 2016, 05:10 PM

when using the online demo in the Firefox browser
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/printing/defaultcs.aspx

I change the page size to 20
then click the print button a pdf is the displayed showing all 20 items when I print I get only one page.

Also you have ExportSettings-IgnorePaging="true" yet when using the print button only what shows on screen is printed.

If there are limitations to the new print button are they explained anywhere?

Thanks

 

 

0
Viktor Tachev
Telerik team
answered on 20 May 2016, 11:21 AM
Hello Ken,

The print functionality is intended to print what is currently displayed in the grid. Note that this functionality is different than exporting.

If you would like to have all items printed you would need to show all records first and then click the Print button.

Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Ken
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or