This is a migrated thread and some comments may be shown as answers.

Copy and paste rows in kendo ui asp.net mvc grid

1 Answer 863 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Annie
Top achievements
Rank 1
Annie asked on 11 Oct 2014, 07:13 PM
Hi,

Do you have sample code for selecting, then copying and pasting the selected rows to other rows in the kendo ui asp.net mvc grid

Thanks,
Annie

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 14 Oct 2014, 03:13 PM
Hello Annie,

Copy-pasting to the Kendo UI Grid can be achieved with custom code. Here is an example to help you get started. You may need to modify it according to your preferences and needs.

http://dojo.telerik.com/Acub

The idea is to add a transparent textarea over the Grid when the widget is focused. The user will actually paste inside the textarea without knowing that. When something is pasted, it will be your task to parse the pasted content and populate the Grid via its dataSource API. When the user focuses something else on the page, the textarea should be removed.

The above example expects the pasted content to match the order and number of the grid columns. You can use any other custom logic, which will suit your users' behavior, but in the standard case, you will need to require the pasted data to be in a certain format and/or meet some other requirements.

Please keep in mind that the functionality won't work if the grid keyboard navigation or selection is enabled. Generally, selection in the source Grid cannot be related to copy-pasting, because the clipboard cannot be controlled via Javascript, i.e. by Kendo UI.

In order to enhance the above example, you will need to be familiar with Grid and Grid DataSource API methods.

http://docs.telerik.com/kendo-ui/api/web/grid

http://docs.telerik.com/kendo-ui/api/framework/datasource

Regards,
Dimo
Telerik

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Tags
Grid
Asked by
Annie
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or