Hello
I have a webgrid in my webform and I would like to print this along with its data. I have used ultraGridPrintDocument1 and ultraPrintPreviewDialog1 for printing ultragrid in winfrom. Is there any such controls available in web ? And if not, how to print grid?
Thanks
You can always search our forums for solutions, I just run a search on "printing" and found two very helpful articles
1) Print Preview option in UltraWebGrid
http://forums.infragistics.com/forums/p/9775/40811.aspx#40811
2) Print
http://forums.infragistics.com/forums/p/5705/25227.aspx#25227
3) Print Stylesheets and Ultrawebgrid
http://forums.infragistics.com/forums/p/3249/17797.aspx#17797
There are plenty of suggestions and ideas there. I personally would recommend export to print friendly media first (PDF) and then printing (suggestion with code in the second link), but any other approach is fine as well.
Thanks for your reply. I have tried to use ReadOnly = printfriendly. But it disables the ajax and javascript on my grid. Below is my sample code. I want to get back my grid into normal mode(level zero) after printing the grid.
protected void PrintFriendly_Click(object sender, EventArgs e) {
ManagementDetailsUltraWebGrid.Browser = BrowserLevel.DownLevel; ManagementDetailsUltraWebGrid.DisplayLayout.LoadOnDemand = LoadOnDemand.NotSet; ManagementDetailsUltraWebGrid.DisplayLayout.ReadOnly = ReadOnly.PrintingFriendly; const string script = "<script language=javascript> " + " var prtContent = document.getElementById('printGrid'); " + " var WinPrint = window.open(); " + " WinPrint.document.write(prtContent.innerHTML); " + " WinPrint.document.close(); " + " WinPrint.print(); " + " WinPrint.close(); " + "</script> "; Page.RegisterStartupScript("Script", script); ManagementDetailsUltraWebGrid.DisplayLayout.ReadOnly = ReadOnly.LevelZero; }
Please see if you can help me. Its urgent