hi
Just like what we have a Print Preview option in WinForms,I need to open a Print Preview page from UltraWebGird, is it possible ..
regards
winnie
WebGrid doesn't have its own printing methods. Instead, you should use the printing and print-preview functionality of the browser, either from the appropriate menu options or by calling JavaScript functions such as "window.print()".I suggest that you look at the "printing friendly" option that WebGrid has. Otherwise, the page that you print will look exactly as it does on the screen - with scrollbars, if your screen is showing scrollbars. Turning on the "printing friendly" mode disables all JavaScript for the grid and sends its HTML output such that the result is much nicer for printing.
I tryed this code to print the grid,
---------------------------------------------------------------------------------------------------------------------------------------------
void printButton_Click(object sender, EventArgs e) { _gridControl.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.DownLevel; _gridControl.DisplayLayout.LoadOnDemand = LoadOnDemand.NotSet; _gridControl.DisplayLayout.ReadOnly = ReadOnly.PrintingFriendly; string script = "<script language=javascript> " + " var prtContent = document.getElementById('" + div.ClientID + "'); " + " var WinPrint = window.open(); " + " WinPrint.document.write(prtContent.innerHTML); " + " WinPrint.document.close(); " + " WinPrint.print(); " + " WinPrint.close(); " + "</script> "; this.Parent.Page.RegisterStartupScript("Script", script); }
it show the grid in a new window but if I move the mouse over the new window I get a Javascript error on this event
onmousemove='igtbl_cellMouseMove(event,"wpmxwp986637087xTabControlxxctl2xGridControl");
I think that when i set the grid to printfriendly all the javascript are disabled
?