Reputation: 29
Trying to print a datagrid in silverlight triggered by a button Any solutions?
Upvotes: 0
Views: 292
Reputation: 1493
referring to this article Printing in silverlight
Use System.Windows.Printing.PrintDocument
There are three events to handles printing. They are
use Print() to do the print operation set the DocumentName property for the name.
PrintDocument
classWrite code to handle the PagePrint
event
private void mybutton_Click(object sender, RoutedEventArgs e) { PrintDocument prt = new PrintDocument(); prt.PrintPage +=(s,args) => { args.PageVisual = txtBlcok; }; prt.Print(); }
Upvotes: 0
Reputation: 94625
Use classes of System.Windows.Printing Namespace.
Articles :
Upvotes: 2