This sample illustrates how to disable the print preview in UWP DataGrid (SfDataGrid).
DataGrid provides support to print the data displayed in the DataGrid using SfDataGrid.Print method.
You can disable the print preview in print dialog by setting PrintTask.IsPreviewEnabled property to false.
this.dataGrid.PrintTaskRequested += DataGrid_PrintTaskRequested;
private void DataGrid_PrintTaskRequested(object sender, DataGridPrintTaskRequestedEventArgs e)
{
e.PrintTask = e.Request.CreatePrintTask("Printing", sourceRequested =>
{
sourceRequested.SetSource(e.PrintDocumentSource);
});
e.PrintTask.IsPreviewEnabled = false;
}Take a moment to peruse the UWP DataGrid - Printing documentation, where you can find about DataGrid printing with code examples.
Visual Studio 2015 and above versions
