Hello,
Trying to implement a simple print in SL4. I have a DataGrid that I would like to print out, but thus far whatever I try to print out comes out as a blank page in the printer. It also seems to take about 30-60 seconds to actually print out (but that could be an unrelated issue).
My code is fairly straightforward:
private void MenuPrint_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
PrintDocument document = new PrintDocument();
document.PrintPage += (s, args) =>
{
args.PageVisual = this.MainDataGrid;
// args.PageVisual = this.LayoutRoot;
};
// Print
document.Print("Test Print Job");
}
I've even wondered if it is because the items are too large?
The XAML for the MainDataGrid control is fairly straight-forward as well:
<sdk:DataGrid Grid.Row="3" AutoGenerateColumns="True" Name="MainDataGrid" FontSize="10" Visibility="Visible" />