OnExcelExportCellFormatting Event
Fired when RadGrid is exported to Excel before the resulting document is rendered on the client.
Event Parameters
-
(object)
sender- The control that fires the event
-
(ExportCellFormattingEventArgs)
e-
Event arguments
-
(TableCell)
e.CellGets the cell for formating
-
(GridColumn)
e.FormattedColumnGets the column associatied with the formating cell.
-
-
Attaching the event
In the Markup
<telerik:RadGrid ID="RadGrid1" runat="server" OnExportCellFormatting="RadGrid1_ExportCellFormatting">
</telerik:RadGrid>
In the Code behind
protected void Page_Init(object sender, EventArgs e)
{
RadGrid1.ExportCellFormatting += RadGrid1_ExportCellFormatting;
}
Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
AddHandler RadGrid1.ExportCellFormatting, AddressOf RadGrid1_ExportCellFormatting
End Sub
The event handler
protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
TableCell cell = e.Cell;
GridColumn formattedColumn = e.FormattedColumn;
}
Protected Sub RadGrid1_ExportCellFormatting(ByVal sender As Object, ByVal e As ExportCellFormattingEventArgs)
Dim cell As TableCell = e.Cell
Dim formattedColumn As GridColumn = e.FormattedColumn
End Sub