or
ExportToPDF exporter =
new
ExportToPDF(
radGridView1
);
exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
exporter.SummariesExportOption = SummariesOption.ExportAll;
exporter.FitToPageWidth =
false
;
exporter.Scale = 1;
exporter.FileExtension =
"pdf"
;
exporter.TableBorderThickness = 1;
exporter.PdfExportSettings.EnableCopy =
true
;
exporter.HTMLCellFormatting +=
new
Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exporter_HTMLCellFormatting);
exporter.ExportVisualSettings =
true
;
exporter.ExportHierarchy =
true
;
exporter.PdfExportSettings.FontType = Telerik.Apoc.Render.Pdf.FontType.Embed;
HTMLCellFormatting
event:void
exporter_HTMLCellFormatting(
object
sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
{
if
(
radGridView1
.Columns[e.GridColumnIndex].DataType == Type.GetType(
"System.Decimal"
))
{
// Some code to manage the format
//e.HTMLCellElement.Value = string.Format(ecc ecc)
}
}
e.HTMLCellElement
belongs to the master template in the hierarchical order. But when the current cell belongs to a child template it seems there is no way to retrieve the cell's column datatype because there is no way to retrieve what child gridview the cell belongs just starting from the "e" object.e.GridColumnIndex
refers to the MasterTemplate or if it refers to the Child Template inside the
exporter_HTMLCellFormatting
?
GridViewDataColumn oColorName =
new
GridViewDataColumn();
oColorName.UniqueName =
"ColorName"
;
oColorName.HeaderText =
"Color Name"
;
radGridReport.Columns.Insert(6, oColorName);