We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy/duplicate a Row

Thread ID:

Created:

Updated:

Platform:

Replies:

124426 Jun 9,2016 10:07 AM UTC Jun 10,2016 08:55 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Arthur
Asked On June 9, 2016 10:07 AM UTC

Hello,

I want to implement some kind of copy row feature to my grid so you can select a row, click on a button on the toolbar and simply get the content of that row in the input fields of a new row. Is this possible?

Thanks

Venkatesh Ayothi Raman [Syncfusion]
Replied On June 10, 2016 08:55 AM UTC

Hi Arthur, 

Thank you for contacting Syncfusion support. 

We have achieved your requirement “Copy the record data while clicking the record and insert the copied data to new added record fields” using recordClick and actionComplete event in Grid. Please refer to the code example, sample and Help document, 

Code example: 
<GRID> 
@(Html.EJ().Grid<object>("FlatGrid") 
        . . . .  
              .ClientSideEvents(e=>e.RecordClick("recordClick").ActionComplete("actionComplete")) 
        .Columns(col => 
        { 
            . . . 
             
        })) 
 
 
<Record Click> 
 
function recordClick(args) { 
 
        //Save the data while select the record. 
        OrderID = args.data["OrderID"] 
       
        CustomerID = args.data["CustomerID"]; 
       
        EmployeeID = args.data["EmployeeID"]; 
       
        Freight = args.data["Freight"]; 
        OrderDate = args.data["OrderDate"]; 
        ShipCity = args.data["ShipCity"]; 
 
 
    } 
 
<ActionComplete> 
 
function actionComplete(args) { 
 
        if (args.requestType == "add" && this.model.isEdit) 
        { 
 
            //store the saved data into new added row 
 
            $("#" + this._id + this.model.columns[0]["field"]).val(OrderID); 
            $("#" + this._id + this.model.columns[1]["field"]).val(CustomerID); 
            $("#" + this._id + this.model.columns[2]["field"]).val(EmployeeID); 
            $("#" + this._id + this.model.columns[3]["field"]).val(Freight); 
            $("#" + this._id + this.model.columns[4]["field"]).val(OrderDate); 
            $("#" + this._id + this.model.columns[5]["field"]).val(ShipCity); 
 
 
 
           
        } 
 
    } 
     



Help document: 

 
Regards, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;