Copy and Edit

4 posts, 0 answers
  1. Insad
    Insad avatar
    41 posts
    Member since:
    Jan 2010

    Posted 26 Sep 2017 Link to this post

    Hi,

    Is there an easy way to copy a record and then start the edit for this record in one go?

    During the copy some data might be changed before the record is added and edited.

     

    I have setup a sample script here:

    http://dojo.telerik.com/@Insad/epERa

     

    But I don't know how to go from there.

     

    What I have done is take a simple grid, added a custom button in the command column and attached the click to a function inside my viewModel.

    Here I can get the current dataItem, change the ProductName, set the ProductID to null and add it to the datasource and force a refresh of the grid.

    But what happens is that the original item in the grid has the changed ProductName in it and a new record is added at the very end of the grid, without a ProductID.

    How I get the edit started is also not known to me at this time.

     

    Is there another way? Is there a sample for this somewhere (didn't find anything in the forum or with Google)?

     

    Best regards,

     

    Insad

  2. Insad
    Insad avatar
    41 posts
    Member since:
    Jan 2010

    Posted 26 Sep 2017 in reply to Insad Link to this post

    Note that preferably I would like to do this at datasource level if possible.

    Also note that I'm using the MVVM model.

  3. Insad
    Insad avatar
    41 posts
    Member since:
    Jan 2010

    Posted 26 Sep 2017 Link to this post

    Okay, I must have been looking with my nose.

    I found the same question here: Custom command Duplicate Row

    There are some things with it but I will mention them in that thread to keep the issues together :)

     

    Sorry for the duplicated item :(

  4. Stefan
    Admin
    Stefan avatar
    3001 posts

    Posted 28 Sep 2017 Link to this post

    Hello, Insad,

    Thank you for linking the related forum post.

    I provided an answer there.

    If additional assistance is needed, please continue the discussion in only one of the threads by your choice.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top