This is a migrated thread and some comments may be shown as answers.

Printing page range

1 Answer 211 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 07 Dec 2011, 05:48 PM
Hello Telerik,
I'm following the demo titled "GridView Printing Paged Data" and I got some problem selecting a print range... since my view can have a lot of items I wish to let the user select a range...

Here's my PrintPreview method

public static void PrintPreview(GridViewDataControl source)
       {
           Window window = new Window();
           window.Title = "Print Preview";
 
           DocumentViewer documentViewer = new DocumentViewer();
           PrintDialog printDialog = new PrintDialog();
 
           printDialog.PageRangeSelection = PageRangeSelection.UserPages;
           printDialog.UserPageRangeEnabled = true;
 
           printDialog.MaxPage = 40;
           documentViewer.Document = ToFixedDocument(ToPrintFriendlyGrid(source), printDialog);
            
           window.Content = documentViewer;
 
           window.ShowDialog();
       }

It shows me only Print alla pages...what am I doing wrong?
Thanks
Paolo

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Dec 2011, 02:24 PM
Hello Paolo,

As you may have noticed, a clone RadGridView is created for printing purposes in the ToPrintFriendlyGrid. There the ItemsSource of the cloned GridView is set. You could changed this ItemsSource so that it contains only a range of the entire original data in the ItemsSource. Then the items in this ItemsSource will be printed. More information about the PrintDialog could be found here.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Michele
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Share this question
or