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

Pasting Tab-Separated Values in the Grid from Excel

Environment

ProductProgress® Kendo UI Grid

Description

How can I paste tab-separated values from Excel in the Kendo UI for Angular Grid?

Solution

Transfer data from Microsoft Excel by using the Clipboard.

In Latest Browser Versions

  1. Access the data that is copied from Excel in the paste event.
  2. Convert the raw data to a plain text format (tab-separated values) by calling the clipboardData.getData('text') method.

The following example demonstrates how to use the paste event to receive the data and then bind the Kendo UI Grid for Angular to it.

Example
View Source
Change Theme:

In Legacy Browsers

The suggested approach is not supported in Internet Explorer version 11 or earlier. To paste TSV from Excel when in legacy browsers, use a hidden textarea element instead.

The suggested workaround for legacy browsers is a last-resort solution because it prevents the focusing of the Grid elements.

Example
View Source
Change Theme: