Click here to Skip to main content
11,581,852 members (72,002 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Silverlight
Hi,
I am working in silverlight and i have one Grid with many Rows.
In My Grid Row there are many control for display purpose.
Now i want to print this Grid with all row.
I found many solution for PrintDocument in Silverlight but it print only first page multiple time.

My code is like,
void btnPrint_Click(object sender, RoutedEventArgs e)
{
       PrintDocument pd = new PrintDocument();
       pd.PrintPage += new EventHandler<PrintPageEventArgs>(pd_PrintPage);
       pages.Add(grdMain);
       pd.Print("Title1");
}
 
void pd_PrintPage(object sender, PrintPageEventArgs e)
{
      e.PageVisual = grdMain;
      e.HasMorePages = true;
}
 

When i add e.HasMorePages = true that time it will going to infinite loop and does not print.

Please help me...
Posted 7-Aug-12 19:29pm
Comments
Kenneth Haugland at 8-Aug-12 1:39am
   
You'll have to set the printarea to include hte whole table, not only whats visible.
Savalia_Manoj at 8-Aug-12 1:57am
   
Thanks Kenneth Haugland for Reply.
But how to set PrintArea in Silverlight?
Christian Amado at 10-Aug-12 9:55am
   
@Savalia_Manoj Solutions helped to you?
Savalia_Manoj at 13-Aug-12 0:28am
   
Thanks Christian Amado,
I want to print multiple page not single page.This link gives single page example.Please give me multiple page link if you know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 340
1 Sergey Alexandrovich Kryukov 160
2 Frankie-C 105
3 F-ES Sitecore 85
4 virusstorm 84
0 OriginalGriff 1,273
1 Sergey Alexandrovich Kryukov 900
2 Abhinav S 617
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100