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.
Unfortunately, activation email could not send to your email. Please try again.

Printing column sizing issue

Thread ID:

Created:

Updated:

Platform:

Replies:

45734 Jun 27,2006 05:33 PM Jun 29,2006 01:15 PM Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 27, 2006 05:33 PM

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 05:58 PM

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 12:20 PM

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 02:54 AM

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:06 AM

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 01:15 PM

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.

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.

;