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

Copy and Edit

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Insad
Top achievements
Rank 2
Insad asked on 26 Sep 2017, 12:17 PM

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

3 Answers, 1 is accepted

Sort by
0
Insad
Top achievements
Rank 2
answered on 26 Sep 2017, 12:22 PM

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

Also note that I'm using the MVVM model.

0
Insad
Top achievements
Rank 2
answered on 26 Sep 2017, 01:59 PM

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 :(

0
Stefan
Telerik team
answered on 28 Sep 2017, 07:54 AM
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.
Tags
Grid
Asked by
Insad
Top achievements
Rank 2
Answers by
Insad
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or