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

Print Ranges

Thread ID:

Created:

Updated:

Platform:

Replies:

10972 Feb 18,2004 02:07 PM UTC Apr 22,2004 02:36 PM UTC Windows Forms 6
loading
Tags: GridControl
Steve
Asked On February 18, 2004 02:07 PM UTC

How can I specify a print range, or more specifically set the print range to only include the right most columns that contain data? For example, when I look at the Grid Pad example, and press print preview, how can I specify a certain number of pages, or better yet the number of pages that exist? Thanks Steve

Administrator [Syncfusion]
Replied On February 18, 2004 04:03 PM UTC

If you only want to print certain columns/rows, then handle the QueryColWidth/QueryRowHeights event(s). In your event handler, if e.Index point to a col/row that you don''t want to print and if grid.PrintingMode is true, then set e.Size = 0. This will essentially hide any col/row you don''t want to see. Here is a KB link that prints a footer showing the page count 1 of xx. It gets the page count from teh printersettings.maximumpages property. http://www.syncfusion.com/Support/article.aspx?id=10376

Steve
Replied On February 18, 2004 04:53 PM UTC

Is there a way to simply specify a print range, say I want to print cells 1,1 to 5,5.

Administrator [Syncfusion]
Replied On February 18, 2004 05:47 PM UTC

If you have cells selected in the grid, you can print them with code like: GridPrintDocument pd = new GridPrintDocument(this.gridControl1, true); PrintPreviewDialog dlg = new PrintPreviewDialog() ; pd.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.Selection; dlg.Document = pd; dlg.ShowDialog(); If you need to select the cells from code, you can add code like: this.gridControl1.Selections.Add(GridRangeInfo.Cells(1,1,5,5));

Steve
Replied On February 18, 2004 07:08 PM UTC

Thank you!

Steve
Replied On February 18, 2004 07:08 PM UTC

Thank you!

Don
Replied On April 22, 2004 02:36 PM UTC

I'd just like to add that the following line of code given above: this.gridControl1.Selections.Add(GridRangeInfo.Cells(1,1,5,5)); did not work for me, but this code did: this.gridControl1.Selections.Ranges.Add(GridRangeInfo.Cells(1, 1, 5, 5))

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

;