# Export to CSV

The export feature allows you to save the data from the DataGrid component to few [different formats](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/overview#supported-formats). This article shows how to save it to **csv**.

## Exporting the Document

The feature works with the `Export` and `ExportAsync` methods of `RadDataGrid`. The methods allow you to provide a stream (usually pointing to a file), a document format and export options objects.

#### **Export DataGrid to CSV format**

```C#
string projectRootFolderPath = System.IO.Path.GetFullPath("../../../../../../", AppDomain.CurrentDomain.BaseDirectory);
using (var stream = File.Open(projectRootFolderPath + "\\" + "SampleDocument.csv", FileMode.OpenOrCreate))
{
	this.dataGrid.Export(stream, ExportFormat.Csv);
}
```

To include additional settings for the document, use the `DataGridExportOptions` class. Read more about the available settings in the [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data#export-options) article.

#### **Using the DataGridExportOptions**

```C#
string projectRootFolderPath = System.IO.Path.GetFullPath("../../../../../../", AppDomain.CurrentDomain.BaseDirectory);
using (var stream = File.Open(projectRootFolderPath + "\\" + "SampleDocument.csv", FileMode.OpenOrCreate))
{
	this.dataGrid.Export(stream, ExportFormat.Csv, new DataGridExportOptions()
	{
		ShowColumnHeaders = true,
	});
}
```

> tip The **exporting process can be customized** at runtime using the `ElementExporting` and `ElementExported` events of `RadDataGrid`. Read more in the [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data) article.

## See Also

* [Getting Started](https://www.telerik.com/winui/documentation/controls/raddatagrid/gettingstarted)
* [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data)
* [Export to Xls and Xlsx](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/xlsx)
* [Export to PDF](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/pdf)
