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.
Unfortunately, activation email could not send to your email. Please try again.

printing virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

29473 May 25,2005 07:19 PM Sep 3,2005 03:08 PM Windows Forms 7
loading
Tags: GridControl
joe lacson
Asked On May 25, 2005 07:19 PM

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

Administrator [Syncfusion]
Replied On May 25, 2005 07: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

joe lacson
Replied On June 3, 2005 01: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

Administrator [Syncfusion]
Replied On June 3, 2005 10: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.

joe lacson
Replied On June 5, 2005 02: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.

Administrator [Syncfusion]
Replied On June 5, 2005 06: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.

Jose Lacson
Replied On September 3, 2005 02: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.

Administrator [Syncfusion]
Replied On September 3, 2005 03: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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;