且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

[UWP]如何在数据网格控件中打印数据

更新时间:2022-10-15 08:22:14


为了打印数据网格,你可以使用  PrintManager类  PrintDocument
Class
 来做到这一点。将您需要打印的元素添加到  printDocument对象,然后您可以打印它。有关详细信息,请查看此文档: Print
来自你的应用程序


还有一个官方样本你可以参考: Printing >> 


祝你好运,


Roy


I am considering using Windows Community Toolkit DataGrid control to display and edit data. However, I am not sure how I can then print that data to either Pdf or the printer. Can you please provide a sample?

Hi,

For printing the datagrid, you could using PrintManager Class and PrintDocument Class to do that. Add the element that you need to print to the printDocument object then you could print it. For more information, please take a look at this document:Print from your app

There is also an official sample that you could refer:Printing 

Best regards,

Roy