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.
Syncfusion Feedback

Column Width on Printing

Thread ID:

Created:

Updated:

Platform:

Replies:

14861 Jun 7,2004 01:56 PM UTC Jun 7,2004 05:47 PM UTC Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 7, 2004 01:56 PM UTC

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.

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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)

Administrator [Syncfusion]
Replied On 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?

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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.

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

;