The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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)
Let me know if this helps for you. Regards, Rajagopal
JQJonathan QuailAugust 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
ADAdministrator Syncfusion Team 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. Regards, Rajagopal