# Style Exported ExcelML

You can use the ExportFormat.ExcelML to export RadGridView's content to a "xls" file. An example is available in the [Grid Export](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/generic/export) article.

## Set Exported Element's VisualParameters

> important You can utilize the **ElementExporting** event as of **Q3 2013** GridViewElementExportingEventArgs  exposes a new argument **VisualParameters**. Please note that it is only valid when exporting with **ExportFormat.ExcelML** and **ExportFormat.Html**.

The **VisualParameters** property for this format is of type **GridViewExcelMLVisualExportParameters**. It has three public properties:

* **StyleId**

* **DataType:**

  1. ExcelMLDataType.DateTime - in order to have a DateTime column exported, you must also set a valid ExcelMLStyle specifying a correct format

  2. ExcelMLDataType.Boolean

  3. ExcelMLDataType.String

  4. ExcelMLDataType.Number

* **RowHeight**

> Please note that you should first have set a valid Style in order to assign it when the ElementExporting event is raised.

> The **RowHeight** property applies when the exported element is **Row**. The **DataType** property applies when exported element is **Cell**.

For example:

**Example 1: Set the style of the exported element**

```C#
private void clubsGrid_ElementExporting(object sender, GridViewElementExportingEventArgs e)
{
    if (e.Element == ExportElement.Cell)
    {
        var column = e.Context as GridViewDataColumn;
        if (column.Header.ToString() == "Name")
        {
            (e.VisualParameters as GridViewExcelMLVisualExportParameters).StyleId = "someStyle";
        }
    }
}
```

You can define the Style when **InitializingExcelMLStyles** event is raised. For example:

**Example 2: Define a style:**

```C#
private void clubsGrid_InitializingExcelMLStyles(object sender, ExcelMLStylesEventArgs e)
{
    ExcelMLStyle style = new ExcelMLStyle("someStyle");
    style.Alignment.Horizontal = ExcelMLHorizontalAlignment.Automatic;
    style.Font.Size = 15;
    style.Font.Italic = true;
    e.Styles.Add(style);
}
```

You can check the [Export Events](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/events/datacontext) article for more information on how to define an ExcelMLStyle.

> important **InitializingExcelMLStyles** event will be only raised when exporting with ExportFormat.ExcelML

## See Also

* [SpreadsheetStreamingExport](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/excel/export-with-spreadsheetstreamingexport)
* [ExportToXlsx](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/excel/export-xlsx)
* [ExportToPdf](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/pdf/export-pdf)
