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

Printing column sizing issue

Thread ID:

Created:

Updated:

Platform:

Replies:

45734 Jun 27,2006 09:33 PM UTC Jun 29,2006 05:15 PM UTC WinForms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 27, 2006 09:33 PM UTC

Hi, I''ve attached a sample that demonstrates the issue I''m encountering. It seems that measuring the cell''s text returns slightly different results if displaying to screen versus printing. Is there a way to print the grid so that the top-left cell looks just like it does on screen without manually resizing columns? Thanks

issue7.zip

Administrator [Syncfusion]
Replied On June 27, 2006 09:58 PM UTC

Hi Tomas, Try calling the ResizeToFit method for resizing the columns in a grid. Here is a code snippet. ''form Load gm.ColWidths.ResizeToFit(GridRangeInfo.Cols(1, 4)) Let me know if this helps. Best Regards, Haneef

Administrator [Syncfusion]
Replied On June 28, 2006 04:20 PM UTC

Hi, Resizing the columns through code only serves to swap the cut-off cells. It also shrinks any columns with empty cells. My users won''t be happy if their columns are one size on-screen and another when printed. I need to be able to preview and print a grid and have the result look the same as what''s on the screen. This seems to me like a text measuring issue since the text fits into the cells on-screen but does not when printed. Perhaps Clay could offer some advice? Thanks

Administrator [Syncfusion]
Replied On June 29, 2006 06:54 AM UTC

Hi Tomas, This seems to be a GDI+ calculating the alignment and string width issue. You can see the following KB article which has a workaround for this issue. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=24 And here is your modified sample. Print.zip Let us know if this helps. Best Regards, Leo.

Administrator [Syncfusion]
Replied On June 29, 2006 09:06 AM UTC

Hi Tomas, This seems to be a GDI+ calculating the alignment and string width issue. You can see the following KB article which has a workaround for this issue. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=24 And here is your modified sample. Print.zip Let us know if this helps. Best Regards, Leo.

Administrator [Syncfusion]
Replied On June 29, 2006 05:15 PM UTC

Hi Leo, Thanks for the modified sample; it eliminates the problem. I''m just unclear as to what the solution does differently than what the grid would do. The sample uses GDI+ to draw the string and only does custom measuring if the string is right aligned. Doesn''t the grid also use GDI+ to draw its strings? Thanks.

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.

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

;