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); }
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); }
public virtual void Initialize() { this.PrintRenderer = this.InitializePrintRenderer(this.GridView); this.traverser = new PrintGridTraverser(this.GridView.MasterView); }