Skip to main content
All docs
V23.2
Tab

ASPxGridView.ExportCsvToResponse(String, Boolean, CsvExportOptions) Method

Exports the grid’s data to a file in CSV format with the specified export settings, and writes it to the response in binary format.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public void ExportCsvToResponse(
    string fileName,
    bool saveAsFile,
    CsvExportOptions exportOptions
)

Parameters

Name Type Description
fileName String

The target file’s full path (including the file name and extension).

saveAsFile Boolean

true to display the Save As dialog; false to display the file with exported data within a page.

exportOptions CsvExportOptions

The export options.

Remarks

This method writes files to the response and do not write them to a storage (for example, a file system). The file name should not contain any path to a folder (for example, “C:\Work\Files\file.xxx”).

If the saveAsFile parameter is set to true, the control invokes the “Save As” dialog. However, a browser settings can disable the control to show this dialog. For example, the control does not invoke the “Save As” dialog and automatically downloads a file to the download folder if the “Ask where to save each file before downloading” option is set to false.

If the saveAsFile parameter is set to false, the browser tries to open a file in a new tab. If it fails, the browser invokes the “Save As” dialog (or file downloading).

See Also