New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnExcelMLExportStylesCreated Event

RadGrid fires this event when creating the built-in styles. It could be used not only for modifying the predefined styles but also to define your own (already assigned to a grid table element on ExcelMLExportRowCreated) custom style.

Event Parameters

  • (object) sender

    • The control that fires the event
  • (GridExportExcelMLStyleCreatedArgs) e

    • Event arguments

      • (IStylesCollection) e.Styles

        Gets collection of styles

Attaching the event

In the Markup

<telerik:RadGrid ID="RadGrid1" runat="server" OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated">

In the Code behind

protected void Page_Init(object sender, EventArgs e)
    RadGrid1.ExcelMLExportStylesCreated += RadGrid1_ExcelMLExportStylesCreated;
Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
    AddHandler RadGrid1.ExcelMLExportStylesCreated, AddressOf RadGrid1_ExcelMLExportStylesCreated
End Sub

The event handler

protected void RadGrid1_ExcelMLExportStylesCreated(object sender, GridExportExcelMLStyleCreatedArgs e)
    IStylesCollection styles = e.Styles;
Protected Sub RadGrid1_ExcelMLExportRowCreated(ByVal sender As Object, ByVal e As GridExportExcelMLStyleCreatedArgs)
    Dim styles As IStylesCollection = e.Styles
End Sub

See Also

In this article