Private Sub RadButtonElement2_Click(sender As Object, e As EventArgs) Handles RadButtonElement2.Click Dim pdfExporter As New Telerik.WinControls.Export.GridViewPdfExport(Me.dgv1) pdfExporter.PageSize = New SizeF(356, 216) pdfExporter.FitToPageWidth = True pdfExporter.ExportVisualSettings = True
Dim fileName As String = "D:\ExportedData.pdf" pdfExporter.RunExport(fileName, New Telerik.WinControls.Export.PdfExportRenderer()) End Sub
Dinko | Tech Support Engineer
Telerik team
commented on 08 Dec 2022, 09:27 AM
You can subscribe to the GridViewPdfExport CellFormatting event. In the event handler, you can set the TextWrap property of the CellElement to True.
PrivateSub RadButtonElement2_Click(sender AsObject, e As EventArgs) Handles RadButton1.Click
Dim pdfExporter AsNew Telerik.WinControls.Export.GridViewPdfExport(Me.RadGridView1)
pdfExporter.PageSize = New SizeF(356, 216)
pdfExporter.FitToPageWidth = True
pdfExporter.ExportVisualSettings = TrueAddHandler pdfExporter.CellFormatting, AddressOf MyCellFormattingHandlerDim fileName AsString = "C:\temp\ExportedData2.pdf"
pdfExporter.RunExport(fileName, New Telerik.WinControls.Export.PdfExportRenderer())
EndSubPrivateSubMyCellFormattingHandler(sender AsObject, e As PdfExportCellFormattingEventArgs)
e.CellElement.TextWrap = TrueEndSub