I could not get the title printed on the PDF. How should i go about it? Thanks
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
If e.CommandName = RadGrid.ExportToPdfCommandName Then
IsPdfExport = True
RadGrid1.ExportSettings.ExportOnlyData = False
RadGrid1.ExportSettings.OpenInNewWindow = True
RadGrid1.ExportSettings.Pdf.PageHeight = Unit.Parse("210mm")
RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Parse("297mm")
RadGrid1.ExportSettings.IgnorePaging = True
End If
End Sub
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
If IsPdfExport AndAlso TypeOf e.Item Is GridHeaderItem Then
RadGrid1.ExportSettings.Pdf.Title = "Unpaid/Partial Payment"
Dim headerItem As GridHeaderItem = e.Item
headerItem.Style("horizontal-align") = "left"
headerItem.Style("font-size") = "10pt"
headerItem.Style("background-color") = "lightgray"
For Each cell As TableCell In headerItem.Cells
cell.Style("text-align") = "left"
Next
End If
If TypeOf e.Item Is GridDataItem Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
For Each cell As TableCell In item.Cells
cell.Style("text-align") = "left"
cell.Style("font-size") = "10pt"
If e.Item.ItemType = GridItemType.AlternatingItem Then
e.Item.BackColor = System.Drawing.Color.LightYellow
End If
Next
End If
If IsPdfExport AndAlso TypeOf e.Item Is GridFooterItem Then
Dim footerItem As GridFooterItem = e.Item
footerItem.Style("horizontal-align") = "left"
footerItem.Style("font-size") = "10pt"
For Each cell As TableCell In footerItem.Cells
cell.Style("text-align") = "left"
Next
End If
End Sub