WPF DataGrid Printing Scrolled Visuals
- by RichS
I've been using the DataGrid (from WPF Toolkit), and have successfully created all of my data.
The next step is that I want to print the entire DataGrid (scaled to a single printed page), even though the visible DataGrid in my Window is currently scrolled.
When I prepare the DataGrid for printing, I've tried setting the DesiredSize to PositiveInfinity, and then calling Measure(.), to get the needed size of the DataGrid. But, when I call Arrange(.), it only prints the part of the DataGrid control that is currently visible on-screen. I know how to scale it to the correct size, but can't get the non-visible part of the DataGrid to be output to the printer.
I've tried rendering to a Bitmap (RenderTargetBitmap), but that has the same problem.
I also tried setting the MinHeight and MinWidth to be the same as the DesiredSize to try to /force/ things. But that doesn't work either.
All I ever see in my printed page, is what was visible on-screen.
Does anyone know how to solve this?