예제 #1
0
        protected virtual BaseGridPrintRenderer InitializePrintRenderer(
            RadGridView grid)
        {
            this.UnwirePrintRendererEvents();
            BaseGridPrintRenderer gridPrintRenderer = (BaseGridPrintRenderer)null;

            if ((object)grid.ViewDefinition.GetType() == (object)typeof(ColumnGroupsViewDefinition))
            {
                if (!(gridPrintRenderer is ColumnGroupsViewDefinitionPrintRenderer))
                {
                    gridPrintRenderer = (BaseGridPrintRenderer) new ColumnGroupsViewDefinitionPrintRenderer(grid);
                }
            }
            else if ((object)grid.ViewDefinition.GetType() == (object)typeof(HtmlViewDefinition))
            {
                if (!(gridPrintRenderer is HtmlViewDefinitionPrintRenderer))
                {
                    gridPrintRenderer = (BaseGridPrintRenderer) new HtmlViewDefinitionPrintRenderer(grid);
                }
            }
            else if (!(gridPrintRenderer is TableViewDefinitionPrintRenderer))
            {
                gridPrintRenderer = (BaseGridPrintRenderer) new TableViewDefinitionPrintRenderer(grid);
            }
            gridPrintRenderer.ChildViewPrinting   += new ChildViewPrintingEventHandler(this.renderer_ChildViewPrinting);
            gridPrintRenderer.PrintCellFormatting += new PrintCellFormattingEventHandler(this.renderer_PrintCellFormatting);
            gridPrintRenderer.PrintCellPaint      += new PrintCellPaintEventHandler(this.renderer_PrintCellPaint);
            return(gridPrintRenderer);
        }
예제 #2
0
 public virtual void DrawPage(Rectangle drawArea, Graphics graphics, int pageNumber)
 {
     if (this.PrintRenderer == null || (object)this.GridView.ViewDefinition.GetType() != (object)this.PrintRenderer.ViewDefinitionType)
     {
         this.PrintRenderer = this.InitializePrintRenderer(this.GridView);
     }
     this.PrintRenderer.DrawPage(this.traverser, drawArea, graphics, this.printSettings, pageNumber);
 }
예제 #3
0
 public virtual void Initialize()
 {
     this.PrintRenderer = this.InitializePrintRenderer(this.GridView);
     this.traverser     = new PrintGridTraverser(this.GridView.MasterView);
 }