Completed
Last Updated: 31 Aug 2018 05:53 by Dimitar
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 16 Aug 2018 07:49
Category: GridView
Type: Bug Report
1
FIX. RadGridView - the PrintCellFormatting is not fired if you assign a new TableViewDefinitionPrintRenderer to the GridPrintStyle
To reproduce:
 private void radButton1_Click(object sender, EventArgs e)
        {
            RadPrintDocument printDocument = new RadPrintDocument();
            printDocument.DefaultPageSettings.Landscape = true; 
            printDocument.DocumentName = "Example Case";

            GridPrintStyle style = new GridPrintStyle(this.radGridView1)
            {
                FitWidthMode = PrintFitWidthMode.FitPageWidth,
                PrintGrouping = false,
                PrintSummaries = false,
                PrintHeaderOnEachPage = true,
                PrintHiddenColumns = false,
            };
            
            TableViewDefinitionPrintRenderer renderer = new TableViewDefinitionPrintRenderer(this.radGridView1);
            renderer.PrintPages.Add(
                this.radGridView1.Columns[1],
                this.radGridView1.Columns[2],
                this.radGridView1.Columns[3],
                this.radGridView1.Columns[4],
                this.radGridView1.Columns[5],
                this.radGridView1.Columns[6]);
            style.PrintRenderer = renderer;
            this.radGridView1.PrintStyle = style;

            this.radGridView1.PrintCellFormatting += RadGridView1_PrintCellFormatting;
            radGridView1.Print(true, printDocument);     
        }

        private void RadGridView1_PrintCellFormatting(object sender, Telerik.WinControls.UI.PrintCellFormattingEventArgs e)
        {
        }

Workaround: use the PrintCellFormatting  of the TableViewDefinitionPrintRenderer 
0 comments