For your kind information, we can add and update the edited data to the DataBase in TreeGrid control with the help of “ActionComplete” and “EndEdit” client side event. When we click the update button in the toolbar, EndEdit event will be triggered and there we can get the edited data in the event argument as “args.data.item”. We can pass this item to database using AJAX post method. Please refer the below code snippet to enable the client side events, and add and update the edited changes to the data base.

@(Html.EJ().TreeGrid("TreeGridContainer").

//…

ClientSideEvents(eve=>{

eve.EndEdit("endEdit");

eve.ActionComplete("ActionComplete");

}).

)

@(Html.EJ().ScriptManager())

<scripttype="text/javascript">

function endEdit(args) {

var editedRecord = args.data.item;

//This varible holds the data of the edited record. You can updated it to your remote datasource

$.ajax({

type: "POST",

url: "/TreeGrid/Update", //Update is Server side method

data: editedRecord,

dataType: "json"

});

}

function ActionComplete(args) {

var record = args.data;

if (args.requestType === 'addNewRow') {

//Newly Added Record is obtained here , which can be updated to database