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.
Hello, I have a problem with printing/print preview in SyncFusion Grid. I use autofit to fit the text in each cell.
The grid looks fine on the form, but when I try to print it last characters in some cells are not printed (they are just
cut off). I tried to use different fonts, but it doesn't help. Does anybody know, how I could fix it? I don't
want to calculate the width of each cell by hand.
ADAdministrator Syncfusion Team November 12, 2003 12:26 PM UTC
If you need to have the grid clip text in cells device-independent, thus making the print output look exactly the same as screen output you should specify GraphicsUnit.World for Unit of the standard styles Font object.
Example
In the following code snippet, the GraphicsUnit for standard font for a grid control is change to GraphicsUnit.World.
[C#]
GridStyleInfo standard = model.BaseStylesMap["Standard"].StyleInfo;
Font dfont = Control.DefaultFont;
standard.Font.Unit = GraphicsUnit.World;
standard.Font.Facename = dfont.Name;
standard.Font.Size = GridFontInfo.SizeInWorldUnit(dfont);
Stefan
ADAdministrator Syncfusion Team November 12, 2003 02:17 PM UTC
I try to use this example:
GridStyleInfo standard = gridControl1.BaseStylesMap["Standard"].StyleInfo;
Font dfont = Control.DefaultFont;
standard.Font.Unit = GraphicsUnit.World;
standard.Font.Facename = dfont.Name;
standard.Font.Size = GridFontInfo.SizeInWorldUnit(dfont);
But I have two errors:
1. Syncfusion.Windows.Forms.Grid.GridFontInfo'
does not contain a definition for 'Unit'
2.Syncfusion.Windows.Forms.Grid.GridFontInfo' does not contain a definition for 'SizeInWorldUnit'
ADAdministrator Syncfusion Team November 12, 2003 05:26 PM UTC
What version are you using?
Your code builds in the latest public release, 1.6.1.0, which is availabel for download from your support home page.