Click here to Skip to main content
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 395
1 DamithSL 218
2 Sergey Alexandrovich Kryukov 215
3 Dave Kreskowiak 200
4 Maciej Los 195


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