Hide Print Settings on PdfViewerNavigator

2 posts, 0 answers
  1. Richard
    Richard avatar
    8 posts
    Member since:
    Mar 2018

    Posted 15 Mar 2018 Link to this post

    I can hide the print preview using this code 

    radPdfViewerNavigator1.ShowPrintPreview = false;

    but how can I hide print preview on the picture shown. Thanks

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 15 Mar 2018 Link to this post

    Hello, Richard, 

    Thank you for writing.  

    When you set the ShowPrintPreview property to false the print preview dialog is not shown at all. However, if you need to hide the Print Settings button in the print preview dialog you can use the following code snippet for custom RadPdfViewer implementation: 
      
    public class CustomPdfView : RadPdfViewer
    {
        protected override RadPdfViewerElement CreateViewerElement()
        {
            return new CustomRadPdfViewerElement();
        }
    }
     
    public class CustomRadPdfViewerElement : RadPdfViewerElement
    {
        public CustomRadPdfViewerElement()
        {
        }
     
        public override void PrintPreview(RadPrintDocument document)
        {
            if (document != null)
            {
                document.AssociatedObject = this;
                PdfPrintPreviewDialog dialog = new PdfPrintPreviewDialog(document);
                dialog.Controls["radGroupBoxSettings"].Controls["radButtonSettings"].Visible = false;
                dialog.ThemeName = ((RadControl)this.ElementTree.Control).ThemeName;
                if (dialog.DialogResult != DialogResult.Abort)
                {
                    dialog.ShowDialog();
                }
     
                dialog.Dispose();
            }
        }
    }



    I hope this information helps. Should you have further questions I would be glad to help. 
     
     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top