# Exporting Custom Column

> important As of **R1 2018** the **GetCellContent** method is **no longer** used for exporting a custom column content. Instead, the **GetExportCellContent** one of GridViewBoundColumnBase needs to be overriden. Check **Example 2**.

In order to automatically export a custom column, without handling some of the exporting events, it should implement the **IExportableColumn** interface. The interface exposes the following methods and properties:

* **GetCellContent**: Gets the content of the cell. You can override it to return custom value.
* **DataFormatString**:  Gets or sets the string format applied to the column.
* **ExportedElementWidth**:  Gets the actual width of the column.

> The GridViewBoundColumnBase class implements the interface so you can directly override the method.

#### **\[C#]Example 1: Overriden GetCellContent method**

```C#
protected override object GetCellContent(object item)
{
    var columnProperty = item.GetType().GetProperty(this.DataMemberBinding.Path.Path);
    return string.Format("@ {0} @", columnProperty.GetValue(item, null) as string);
}
```

#### **\[C#]Example 2: Overriden GetExportCellContent method**

```C#
protected override object GetExportCellContent(object item)
{
    var columnProperty = item.GetType().GetProperty(this.DataMemberBinding.Path.Path);
    return string.Format("@ {0} @", columnProperty.GetValue(item, null) as string);
}
```

The values from the exported column will appear in Excel as shown in **Figure 1**.

> caption Exported custom column to excel

![Telerik UI for WPF RadGridView exported custom column values shown in Excel](https://www.telerik.com/products/wpf/documentation/assets/0998b759bd8209e1edd30eeab7b3a44e/gridview_exported-custom-column.png)

## See Also

* [Export Events](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/events/datacontext)
* [Export to Excel](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/excel/export-xlsx)
* [Export to Pdf](https://www.telerik.com/products/wpf/documentation/controls/radgridview/export/pdf/export-pdf)
