Skip to content

GridCsvExportOptions API

Extended documentation for the GridCsvExportOptions interface with detailed information on the module's properties and available APIs.

Demos

Import

import { GridCsvExportOptions } from '@mui/x-data-grid-premium'
// or
import { GridCsvExportOptions } from '@mui/x-data-grid-pro'
// or
import { GridCsvExportOptions } from '@mui/x-data-grid'


The options to apply on the CSV export.

Properties

Optional

If true, the hidden columns will also be exported.

Type:boolean

Default:false


Optional

The character used to separate fields.

Type:string

Default:','


Optional

If false, the formulas in the cells will not be escaped.
It is not recommended to disable this option as it exposes the user to potential CSV injection attacks.
See https://owasp.org/www-community/attacks/CSV_Injection for more information.

Type:boolean

Default:true


Optional

The columns exported.
This should only be used if you want to restrict the columns exports.

Type:string[]


Optional

The string used as the file name.

Type:string

Default:document.title


Optional

Function that returns the list of row ids to export on the order they should be exported.

Type:(params: GridCsvGetRowsToExportParams) => GridRowId[]


Optional

If true, the CSV will include the column groups.

Type:boolean

Default:true


Optional

If true, the CSV will include the column headers and column groups.
Use includeColumnGroupsHeaders to control whether the column groups are included.

Type:boolean

Default:true


Optional

If true, the UTF-8 Byte Order Mark (BOM) prefixes the exported file.
This can allow Excel to automatically detect file encoding as UTF-8.

Type:boolean

Default:false