Completed
Last Updated: 18 Apr 2018 08:26 by Dimitar
ADMIN
Hristo
Created on: 04 Apr 2018 11:18
Category: Spreadsheet
Type: Feature Request
1
FIX. RadSpreadsheet - expose an API notifying that a print or print preview job is underway
Ideally we should expose the events in the RadPrintDocument object.

Workaround handling the PrintPreview method:
private void button1_Click(object sender, EventArgs e)
{
    RadPrintDocument printDocument = new RadPrintDocument();
    IPrintable printManager = typeof(RadSpreadsheetElement).GetProperty("PrintManager", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.radSpreadsheet1.SpreadsheetElement) as IPrintable;
    printDocument.AssociatedObject = printManager;

    printDocument.BeginPrint += PrintDocument_BeginPrint;
    printDocument.PrintPage += PrintDocument_PrintPage;
    printDocument.EndPrint += PrintDocument_EndPrint;
    printDocument.QueryPageSettings += PrintDocument_QueryPageSettings;
    SpreadsheetPrintPreviewDialog printPreviewDialog = new SpreadsheetPrintPreviewDialog(printDocument);
    printPreviewDialog.ThemeName = this.radSpreadsheet1.ThemeName;
    printPreviewDialog.ShowDialog();
}

private void PrintDocument_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
{
    
}

private void PrintDocument_EndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
    
}

private void PrintDocument_BeginPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
    
}

private void PrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
}

0 comments