Completed
Last Updated: 10 Jun 2021 13:10 by ADMIN
Release R2 2021 SP1
Chris
Created on: 25 Nov 2020 18:16
Category: GridView
Type: Bug Report
0
RadGridView: PrintRenderer with multiple pages defined gets reset when the Print Settings dialog is used

If you define which columns to be printed on separate pages and try to use the Print Settings dialog to change the orientation for example, the multi-page printing gets lost: 

https://docs.telerik.com/devtools/winforms/controls/gridview/printing-support/gridprintstyle#multi-page-printing

Here is the code snippet which result is illustrated in the attached gif file:

  
    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.CustomersTableAdapter.Fill(Me.NwindDataSet.Customers)

        Me.RadGridView1.DataSource = Me.CustomersBindingSource
        Me.RadGridView1.BestFitColumns()
    End Sub

    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
 
        Dim document As New RadPrintDocument()
        document.AssociatedObject = Me.RadGridView1

        Dim printStyle As GridPrintStyle = New GridPrintStyle(RadGridView1)
        Dim renderer As TableViewDefinitionPrintRenderer = New TableViewDefinitionPrintRenderer(RadGridView1)
        renderer.PrintPages.Add(RadGridView1.Columns(0), RadGridView1.Columns(2), RadGridView1.Columns(5))
        renderer.PrintPages.Add(RadGridView1.Columns(0), RadGridView1.Columns(1), RadGridView1.Columns(9))
        renderer.PrintPages.Add(RadGridView1.Columns(8), RadGridView1.Columns(7))
        renderer.PrintPages.Add(RadGridView1.Columns(3), RadGridView1.Columns(4), RadGridView1.Columns(6))
        printStyle.PrintRenderer = renderer
        RadGridView1.PrintStyle = printStyle

        Dim dialog As New RadPrintPreviewDialog(document) 
        dialog.ShowDialog() 

    End Sub
0 comments