Example of Clipboard in Blazor DataGrid Component
The DataGrid component's copy to clipboard functionality is demonstrated in this sample. To copy content, select rows and then click the Copy button in the toolbar. To copy with a header, use the toolbar's Copy with Header button.
Order ID | Customer ID | Order Date | Freight | Ship Country |
---|
10001 | ALFKI | 5/15/1991 | $2.30 | Denmark |
10002 | ANATR | 4/4/1990 | $3.30 | Brazil |
10003 | ANTON | 11/30/1957 | $4.30 | Germany |
10004 | BLONP | 10/22/1930 | $5.30 | Austria |
10005 | BOLID | 2/18/1953 | $6.30 | Switzerland |
10006 | ALFKI | 5/15/1991 | $4.60 | Denmark |
10007 | ANATR | 4/4/1990 | $6.60 | Brazil |
10008 | ANTON | 11/30/1957 | $8.60 | Germany |
10009 | BLONP | 10/22/1930 | $10.60 | Austria |
10010 | BOLID | 2/18/1953 | $12.60 | Switzerland |
10011 | ALFKI | 5/15/1991 | $6.90 | Denmark |
10012 | ANATR | 4/4/1990 | $9.90 | Brazil |
Using the Keyboard shortcuts and CopyAsync method, you can copy selected row or cell data from the DataGrid to the clipboard.
In this demo, you can copy data from selected rows to the clipboard by using the keyboard shortcuts or toolbar interactions listed below
- Ctrl + C - Selected rows or cells data without header.
- Ctrl + Shift + H - Displays data from selected rows or cells with a header.
More information about the Clipboard feature can be found in this documentation section.