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

Printing column sizing issue

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

5 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon