You can print the SfDataGrid with Header and Footer content using PrintPageHeaderTemplate and PrintPageFooterTemplate properties in SfDataGrid.PrintSettings. By default, SfDataGrid prints without Header and Footer content. The following XAML code example displays the Footer DataTemplate definition for SfDataGrid. While printing, this data template sets the ContentControl in PrintPageControl. From PrintPageControl, you can access the following properties using Ancestor binding in the data template.
It is also possible to display and print the current DateTime using DateTime.Today as displayed in the following code example. XAML The following code example displays how to set Footer DataTemplate (the above one) to PrintSettings.PrintPageFooterTemplate in SfDataGrid C#
The following screenshot displays the print preview of SfDataGrid with Header and Footer.
Sample Links:
|
This page will automatically be redirected to the sign-in page in 10 seconds.