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. Image for the cookie policy date

Problem with printing/print preview in SyncFusion Grid

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.

3 Replies

AD Administrator Syncfusion Team November 12, 2003 07:26 AM

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


AD Administrator Syncfusion Team November 12, 2003 09:17 AM

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'


AD Administrator Syncfusion Team November 12, 2003 12:26 PM

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.

Loader.
Live Chat Icon For mobile
Up arrow icon