Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2003, 01:42 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default onbeforeprint and datagrid binding

I've created a nested grid with a css style sheet and behavior to get a scrolling grid with fixed header, also I've set up paging. Now, when I print I want to print the entire grid and not just what is seen on screen. So I set up a javascript function to remove css behavior from the grid and do a __dopostback(). This all works correctly as my page reposts without the scrolling and the entire datagrid is exposed. The problem is that the preview/print is printing BEFORE the __dopostback(). I don't get it???

Cory Bonallo
Developer
 
Old October 10th, 2003, 01:49 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is your print command happening before the call to postback? Well, even if it's after it, as soon as you issue that print command, the browser takes a snapshot of the page and dumps it to the print procedure of the browser. This happens before the browser has had a chance to post and redraw the page.

If it's printing OK as you have it right now, you don't even need to do a postback. Just remove the CSS formatting that sets up the scrolling, issue the print command, then switch back on the CSS formatting.

(Of course, all this hinges on the browser supporting the changing of the appropriate styles.)

Peter
 
Old October 10th, 2003, 01:56 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am trying to avoid having a print button on the screen. I want the users to be able to use the print button on the browser. The onBeforePrint() is a built in function for IE 5.0 and above that you can call using javascript. This is where I have the __dopostback and it's supposed to happen BEFORE it prints.

Cory Bonallo
Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding Using DataGrid hoailing22 ASP.NET 1.0 and 1.1 Basics 17 November 14th, 2006 02:17 AM
Datagrid binding two dropdown inkrajesh ASP.NET 1.0 and 1.1 Basics 0 July 18th, 2006 10:46 PM
Binding Data to a DataGrid RPG SEARCH ASP.NET 1.0 and 1.1 Basics 5 August 9th, 2004 02:27 PM
DataGrid Binding GrindCrusher Classic ASP Databases 0 February 21st, 2004 05:52 PM
Binding an aarraylist to a datagrid Delano ADO.NET 2 September 22nd, 2003 05:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.