Landscape by default for printing GanttChartDataGrid (WPF)

If you want to set up printing as Landscape by default when you use GanttChartDataGrid or other components from DlhSoft Gantt Chart Light Library for WPF, it’s as easy as this:

var dialog = new PrintDialog();
dialog.PrintTicket.PageOrientation = PageOrientation.Landscape;
if (dialog.ShowDialog() == true)
{
var documentPaginator = new GanttChartDataGrid.DocumentPaginator(GanttChartDataGrid);
documentPaginator.PageSize = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
dialog.PrintDocument(documentPaginator, "Gantt Chart document");
}

And if you also want to print the entire grid and chart on a single page, just follow the guidelines (or the sample app) here.

About DlhSoft Team

DlhSoft is a software development company focused on building high quality and innovative solutions using state-of-the-art technologies for customers worldwide. Our activity includes designing and developing general purpose software applications, components and tools, and customized software solutions upon request. DlhSoft team is highly experienced and fully dedicated to software development. Additionally, one of the most important things we rely on is the continuous communication with the customer.
This entry was posted in Development Components and tagged , , . Bookmark the permalink.

Add a reply