Click here to Skip to main content
15,167,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
Kenneth Haugland 8-Aug-12 1:39am
   
You'll have to set the printarea to include hte whole table, not only whats visible.
Savalia Manoj M 8-Aug-12 1:57am
   
Thanks Kenneth Haugland for Reply.
But how to set PrintArea in Silverlight?
Christian Amado 10-Aug-12 9:55am
   
@Savalia_Manoj Solutions helped to you?
Savalia Manoj M 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)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900