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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





47250 Jul 31,2006 07:36 PM UTC Aug 2,2006 08:53 AM UTC WinForms 3
Tags: GridControl
Jonathan Quail
Asked On July 31, 2006 07:36 PM UTC


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
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


Jonathan Quail

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

Hi Jonathan,

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

Let me know if this helps for you.

Jonathan Quail
Replied On August 1, 2006 04:48 PM UTC

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 08:53 AM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon