Can the Radgrid print function print a multi page grid?
My grid just prints out the first page - it is more like a print screen function than a print grid function.
Thank You
Doug Juola
djuola@cox.net
1 Answer, 1 is accepted
0
Vessy
Telerik team
answered on 12 Oct 2021, 03:11 PM
Hello Doug,
The Print feature is a client-side functionality of the browser, and it can only print visible HTML elements. If you want to include all the Grid rows for printing, you need to disable the paging. That will tell the grid to render all the Rows at once.
Please take a look at the On button Click Print Grid Data forum post where you can find instructions for print the RadGrid element and using the approach from the Page for client-side export Code Library sample you can disable/enable paging using AJAX request.
Using the combination of the two artciels, the JavaScript method could be something like:
function PrintRadGrid(radGrid) {
// disable paging
setTimeout(function () {
var previewWnd = window.open('about:blank', '', '', false);
var styleStr = "<html><head><link href='Styles.css' rel='stylesheet' type='text/css'></link></head>";
var htmlcontent = styleStr + "<body>" + $find(radGrid).get_element().outerHTML + "</body></html>";