Hi,
I have a asp.net page( .aspx) with user control( .ascx). That user control has a RADGrid with several records with paging turned on.
When We want to print, we would like to print all rows( not just rows of current page showing in the grid).
Currently, when we print, it is printing only the rows from page that is being shown on the grid on the screen.
To solve the problem, we wanted to hookup onBeforePrint and set the page size to max number of rows and revertback during onafterprint event
. For that we have the following client-side javascript function. But the effect on RADGrid is not happening until after we get
the print dialog and click on the print dialog. We would like to know how to make the RADGrid display all rows before
the print dialog so that print process would pick up the grid with all rows.
We are wondering how we can do this without going to server and disable the paging through Ajax.
<script type="text/javascript">
var pageSize;
var PageCount;
function disableGridPaging()
{
var grid = $find("<%= RadGrid_ContactDetails.ClientID %>");
pageSize = grid.MasterTableView.PageSize;
PageCount = grid.MasterTableView.PageCount;
grid.MasterTableView.beginUpdate();
grid.MasterTableView.set_pageSize(grid.MasterTableView.PageSize * grid.MasterTableView.PageCount);
grid.MasterTableView.endUpdate();
}
function revertBackGridPaging()
{
var grid = $find("<%= RadGrid_ContactDetails.ClientID %>");
grid.MasterTableView.beginUpdate();
grid.MasterTableView.set_pageSize(pageSize);
grid.MasterTableView.endUpdate();
}
window.onbeforeprint = disableGridPaging
window.onafterprint = revertBackGridPaging
</script>
thanks,
Srini




