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

2 posts, 0 answers
  1. Annie
    Annie avatar
    10 posts
    Member since:
    Oct 2014

    Posted 11 Oct 2014 Link to this post

    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
  2. Dimo
    Admin
    Dimo avatar
    8472 posts

    Posted 14 Oct 2014 Link to this post

    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.

Back to Top