New to Kendo UI for Angular? Start a free 30-day trial

Angular Data Grid Clipboard

You can perform all standard clipboard operations from and to the Grid by using the system clipboard.

The Grid clipboard supports the following keyboard shortcuts:

SHORTCUTDESCRIPTION
Ctrl/Cmd (for Mac) + CCopy selected or focused content.
Ctrl/Cmd (for Mac) + XCut selected or focused content.
Ctrl/Cmd (for Mac) + VPaste the clipboard content.

The following example demonstrates how the built-in clipboard feature works on multiple Grids.

Example
View Source
Change Theme:

To enable the built-in clipboard feature:

The clipboard feature works with the actual Grid data and affects the current page only. Cell templates are not evaluated.

Clipboard Target

The clipboardTarget property defines the starting point of the clipboard operations. When both selection and navigation features are enabled, the clipboard operations can be applied to the highlighted row(s) or cell(s) or focused cell.

To determine the target of the clipboard operation set theclipboardTarget to:

  • selection (default)—The clipboard will copy the content of all selected cell(s) or row(s) from the current page. On paste, the first selected cell will serve as the pivotal point for the pasted content.
  • activeCell—The clipboard will only copy the content of the current active cell or its row. On paste, the active cell will serve as the pivotal point for the pasted content.

Current Selection

To define the Grid selection as the clipboard operations target, enable the selection functionality, and apply the kendoGridClipboard.

<kendo-grid ...
    [selectable]="true"
    kendoGridClipboard>
</kendo-grid>

The following example demonstrates how to cut or copy selected row(s) and paste the copied content in the same Grid.

Example
View Source
Change Theme:

Active Cell

To set the starting point for the clipboard operations, when the Grid navigation is enabled, set the clipboardTarget property to activeCell.

<kendo-grid ...
    [navigable]="true"
    kendoGridClipboard
    clipboardTarget="activeCell">
</kendo-grid>

The following example demonstrates how to cut or copy focused cell and paste the copied content in the same Grid.

Example
View Source
Change Theme:

Whole Row

To apply the clipboard operations on the entire row data set the wholeRow property of the clipboardSettings option to true. The option is especially useful in the following scenarios:

<kendo-grid ...[clipboardSettings]="{wholeRow: false}"></kendo-grid>

Using Navigation

The following example demonstrates the wholeRow property in action.

Example
View Source
Change Theme:

Using Cell Selection

The following example demonstrates the wholeRow property with multiple cell selection.

Example
View Source
Change Theme:

Including Column Headers

To include the column headers of the copied row(s) in the clipboard, set the copyHeaders property of the clipboardSettings to true.

<kendo-grid ...[clipboardSettings]="{copyHeaders: true}"></kendo-grid>

The following example demonstrates the copyHeaders option is action.

Example
View Source
Change Theme: