Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to Disable Print Preview in UWP DataGrid?

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;
}

Showing the print dialog with print preview disabled

Take a moment to peruse the UWP DataGrid - Printing documentation, where you can find about DataGrid printing with code examples.

Requirements to run the demo

Visual Studio 2015 and above versions

About

This sample illustrates how to disable the print preview in UWP DataGrid (SfDataGrid)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages