Skip to content

An example for copying the datagrid into the user clipboard for copying into Excel

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/devextreme-datagrid-copy-data-to-excel

Repository files navigation

DataGrid for DevExtreme - How to copy data to Excel

This example demonstrates how to copy DataGrid rows into the clipboard for pasting in Excel.

Copy data to Excel

The example implements two different copy actions:

1. Copy row. The command column contains the additional "Copy row" button. Once clicked, the row data will be copied into the clipboard with the appropriate escape characters for Excel.

2. Copy via Export. The onToolbarPreparing event creates the "Copy via Export" button. Both exportDataGrid(options) and customizeCell are used to access the processed data (group, summary, sort, filter, etc.). The data is aggregated into the clipboard with appropriate escape characters for Excel. This method allows you to achieve similar results with the DataGrid's Export to ExcelJS.

You can easily modify the example to achieve different tasks. For example, copy values from a certain column only.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)