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

Column Width on Printing

I''m printing a databound grid. The column headings are long and the printed page puts the column headings into 2 lines but not fully printing it. - How can I make the column headings wider on the printout? Column headings look ok on the form because they''re being automatically adjusted depending on data length. Here''s the code that I''m using: Dim pd As New GridPrintDocument(myDatagrid) Dim dlg As New PrintDialog Dim result As DialogResult dlg.Document = pd dlg.AllowSelection = True dlg.AllowSomePages = True result = dlg.ShowDialog If result = DialogResult.OK Then pd.Print() End If Please provide an example in VB .Net. Thanks.

5 Replies

AD Administrator Syncfusion Team June 7, 2004 02:44 PM UTC

Normally, what you see on the form is the same as the print output. Here is a sample with a long title in one header cell that seems to print ok for me. What are you doing differently? ForumPrint_6897.zip


AD Administrator Syncfusion Team June 7, 2004 04:14 PM UTC

On loading the grid, I have the following code to size the columns: myDatagrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Table, GridResizeToFitOptions.IncludeHeaders)


AD Administrator Syncfusion Team June 7, 2004 05:36 PM UTC

I added the ResizeToFit call at the bottom of the FormLoad in the sample attached above and did not see any difference. Can you see the problem in the attached sample?


AD Administrator Syncfusion Team June 7, 2004 05:43 PM UTC

The sample doesn''t compile on my pc. It''s complaining about these two lines: Me.GridDataBoundGrid1.OptimizeInsertRemoveCells = True Me.GridDataBoundGrid1.UseListChangedEvent = True


AD Administrator Syncfusion Team June 7, 2004 05:47 PM UTC

The samples were done with the latest library code, 2.0.5.1. If you are using an earlier library, you can just comment out those two lines that are giving the syntax error.

Loader.
Up arrow icon