In my grid I placed a custom command "Copy" which copies a value of a column to two other values in other columns in the Click-handler CopyClick. Now I would like to enter the edit mode for the row. How can I do that? I tried grid.editRow(row) but it did not worked. Probably I passed the wrong parameter to it. What must row be as a parameter to editRow()?
@(Html.Kendo().Grid<
MyViewModel
>()
.Name("MyGrid")
.Columns(columns =>
{
columns.Command(command =>
{
command.Edit();
command.Destroy();
command.Custom("Copy").Click("CopyClick");
});
……
function CopyClick(e)
{
e.preventDefault();
var grid = $("#UnterhaltGrid").data("kendoGrid");
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
dataItem.Val1 = dataItem.Val0;
dataItem.Val2 = dataItem.Val0;
grid.refresh();
}