Print Functionality in ASP.Net GridView Control
In this article I’ll explain how to allow the users to print the contents of the ASP.Net GridView control. So let’s start.
I’ll explain two options, first printing the current page of the ASP.Net GridView control and second printing all the pages.
I have already populated a GridView control using the Microsoft Northwind database.
Print Current Page of ASP.Net GridView control
Below is the Button Event handler that is called when the Print Button is clicked
Print All Pages of ASP.Net GridView control
Below is the Button Event handler that is called when the Print All Button is clicked
The only difference in the above function is that I am disabling the paging so that all pages are printed. The screenshot below displays the preview of the ASP.Net GridView that will be printed.
To view the live demo, click here.
With this the article comes to an end. Hope you liked it. Download the sample code in VB.Net and C# using the link belowGridViewPrint.zip (4.74 kb)
For Original Post, Click Here