We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

printing virtual grid

Is there an event similar to TopRowChanging event or any event that fires before the QueryCellInfo that fires when the grid is printing?

7 Replies

AD Administrator Syncfusion Team May 25, 2005 06:59 PM

I do not know of such an event. What are you trying to do? If you need to know the top row and left col of each printed page, you can get that from the grid.PrintInfo object. This thread has code snippets showing how to access this information. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23682


JL joe lacson June 3, 2005 12:30 PM

I''m trying to print a virtual grid at the same time doing a RowHeights.ResizeToFit on the fly. Would I be able to perform a ResizeToFit at any point during printing? >I do not know of such an event. What are you trying to do? > >If you need to know the top row and left col of each printed page, you can get that from the grid.PrintInfo object. This thread has code snippets showing how to access this information. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23682


AD Administrator Syncfusion Team June 3, 2005 09:18 PM

So, you want to have different rowheights while printing from the rowheights you have in the non-printing grid? To do something like this, try handling QueryRowHeight. In your handler, you can test if you are printing using grid.PrintingMode. If you are printing, you can set e.Size to the height you want for the row at e.Index and also set e.Handled = true. So, the only thing left is to determined what the optimal rowheight is. I do not know a good way to do this. You could cache the original rowheights. Then call grid.BeginUpdate. Call grid.RowHeights.ResizeToFit. Cache the optimal hieghts. Reset original rowheights. Call grid.EndUpdate. Then do your prining, an din QueryRowHeights, use the cached optimal heights to set e.Size.


JL joe lacson June 5, 2005 01:38 PM

Actually, I want the same row heights in both printing and non-printing mode. Here''s what I''m trying to do. I have a virtual grid, it has about 25000 rows, and I dont want to populate the grid with all the data at one time. So, everytime TopRowChanging event fires, i fetch more data and populate the grid using the QueryCellInfo and TopRowChanged to do ResizeToFit. And that works fine for non-print mode. If I want to print the grid, I want it work the same way. I''m looking for event similar to TopRowChanging so that I could fetch the data that I need, TopRowChanged to do ResizeToFit while I''m in print mode. Thanks. >So, you want to have different rowheights while printing from the rowheights you have in the non-printing grid? > >To do something like this, try handling QueryRowHeight. In your handler, you can test if you are printing using grid.PrintingMode. If you are printing, you can set e.Size to the height you want for the row at e.Index and also set e.Handled = true. > >So, the only thing left is to determined what the optimal rowheight is. I do not know a good way to do this. You could cache the original rowheights. Then call grid.BeginUpdate. Call grid.RowHeights.ResizeToFit. Cache the optimal hieghts. Reset original rowheights. Call grid.EndUpdate. Then do your prining, an din QueryRowHeights, use the cached optimal heights to set e.Size.


AD Administrator Syncfusion Team June 5, 2005 05:42 PM

I think this will be a problem. The reason is that in GridPrintDocument.BeginPrint, the grid needs to know all the rows so it can prepare an array of values that define where each printed page starts. If the proper number of rows and columns and proper rowheights and colwidths are not known at that point, then the grid''s default printing support will not be able to determine where each printed page begins and how many pages there will be. So, if you are using the default printing support, this grid needs to know all the proper rowheights when BeginPrint is called.


JL Jose Lacson September 3, 2005 01:16 PM

Do you have any samples if I want to handle my own printing? >I think this will be a problem. The reason is that in GridPrintDocument.BeginPrint, the grid needs to know all the rows so it can prepare an array of values that define where each printed page starts. If the proper number of rows and columns and proper rowheights and colwidths are not known at that point, then the grid''s default printing support will not be able to determine where each printed page begins and how many pages there will be. > >So, if you are using the default printing support, this grid needs to know all the proper rowheights when BeginPrint is called.


AD Administrator Syncfusion Team September 3, 2005 02:08 PM

There are 7 KB''s on printing in the Quick Start-Printing section of the Grid KB. Two of them discuss deriving the GridprintDocument to control the printing. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=62 http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=63

Loader.
Live Chat Icon For mobile
Up arrow icon