Silverlight / WPF - Print Generic List values in Silverlight

Asked By gopal krish on 21-Jun-12 07:55 AM

i need to Print Generic List values in Silverlight?

need ur suggestions with examples..

[)ia6l0 iii replied to gopal krish on 21-Jun-12 10:29 PM
If you have Silverlight version 3, you cannot. You have to custom write the objects or render them as bitmap's I guess.

In Silverlight version 4, the PrintDocument class was introduced. Well, I hope you have not scoured the holy internet yet for any articles. David Poll had this article titled "Making printing easier in Silverlight 4" on his blog much much earlier. Here is the link from my bookmarks -

In short,  you need to create a print document, give it a name. Associate the PrintPage handler and in the handler , add the elements to the pageRoot children. And then call the print method.

var pd = new PrintDocument();
pd.DocumentName = "custom print";
pd.PrintPage += pd_PrintPage;

private void pd_PrintPage(object sender, PrintPageEventArgs e)
    var pageRoot = new Canvas();
    e.PageVisual = pageRoot;


Hope it helps.
Vikram Singh Saini replied to gopal krish on 23-Jun-12 05:06 AM
The author at link  suggests how to print List values of type string in silverlight. The code has been provided by author and explained very well.

Here is the link for downloading entire source code:

Hope the links would help you to understand all.