Printing WPF DataGrid Contents
wpf, xaml
Solution
I had this issue some time ago. I wrote a method that generates a System.Windows.Documents.Table from the DataGrid. I put it in a FlowDocument and generated a fixed document thanks to an XpsDocumentWriter. You will then have a full paginated view of your DataGrid that you can visualize in a DocumentViewer
Problem
How can I print the contents of a DataGrid. I have checked out the following post How can I produce a "print preview" of a FlowDocument in a WPF application? and it generates only the visible portion of the grid not the scrollable parts. I would need the preview to have multiple pages and I thiink I should be using the FlowDocument but I am not sure how to go about it. Any ideas would be appreciated.