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.

GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

47250 Jul 31,2006 03:36 PM Aug 2,2006 04:53 AM Windows Forms 3
loading
Tags: GridControl
Jonathan Quail
Asked On July 31, 2006 03:36 PM

Hello,

Is there any way to print a grid without any data in it? Essentially, in our application we have the option to print a blank form - even from a form with data on it. But the "DrawGrid" method in GridControlBase prints the text as well.

So is there a way to:
A) Print the page without data in the grid (but perhaps with blank rows/columns to fill the size of the grid on the page
or
B) Print the page without data, and the grid appears to have no columns/rows (so it looks like it would when it is bound to a table with no data)

We are using 4.2.0.37

Thanks,

Jonathan Quail

Administrator [Syncfusion]
Replied On August 1, 2006 02:10 AM

Hi Jonathan,

Please try the attached sample that demonstrates the way to achieve this behavior.
Here is a sample
GDBG_Print.zip

Let me know if this helps for you.
Regards,
Rajagopal

Jonathan Quail
Replied On August 1, 2006 12:48 PM

Yes that worked - We have our own Print Manager implementation, but the setting of the e.Style.CellValue in OnPrepareViewStyleInfo worked perfectly.

Just two quick questions about that though.

1. Will the setting of e.Style.CellValue have any effect on bound data? Our grids are bound to DataViews - will that change the data at all?

2. What is the purpose of calling the "Invalidate ()" before and after the print? I was able to get it to work without calling those methods. Was that just a fluke?

Thank you for your help!

Jonathan Quail

Administrator [Syncfusion]
Replied On August 2, 2006 04:53 AM

Hi Jonathan,

1. The PrepareviewStyleInfo event does not store any styleInfo properties in a grid, it just sets the visual style appearance for the grid. The idea was that to visually make the cell contents in the grid to null before printing through the PrepareviewStyleInfo event handler and reset them back after printing. This will not make any changes to the bound data.

2. There are many situations where you don''t want to re-draw the entire control but just a portion of it - and that''s where Invalidate() can be used. I have used this to avoid the painting problems that may occur when changes to the grid are made by the PrepareviewStyleInfo.

Thanks for using Syncfusion Products.
Regards,
Rajagopal

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.

;