Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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