Hello,
Assuming I have a two levels hierarchical grid that is build dinamically where I don't know the number of the child grids and where the master template is different respect to the child template.
In order to export to pdf a gridview that contains child gridviews (hierarchical grid) I create an ExportToPDF object:
I need to format the cell value in the case it is type Decimal so I have added a new handle for the
In this event handler I need to retrieve the DataType of the current column and this code works perfectly if the current cell
So my question is: is there a way to understand if the index
Thanks for any aid,
Alcide
Assuming I have a two levels hierarchical grid that is build dinamically where I don't know the number of the child grids and where the master template is different respect to the child template.
In order to export to pdf a gridview that contains child gridviews (hierarchical grid) I create an ExportToPDF object:
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;
I need to format the cell value in the case it is type Decimal so I have added a new handle for the
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)
}
}
In this event handler I need to retrieve the DataType of the current column and this code works perfectly if the current cell
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.So my question is: is there a way to understand if the index
e.GridColumnIndex
refers to the MasterTemplate or if it refers to the Child Template inside the
exporter_HTMLCellFormatting
?Thanks for any aid,
Alcide