Sagar Pallavi

Sagar Pallavi

  • 1.6k
  • 162
  • 15.1k

Pass selected records from Kendo Grid to the controller

Dec 3 2020 2:00 AM
Hi Team,
Looking for sample code to pass selected row of Kendo Grid values from View to Controller.
I need to pass selected row values  of Grid to the controller. I am able to pass
one value from view to controller but I am unable to pass the details of other columns.
 
I tried below:
#(document).ready (function () {
$('#btnDelete').click(function () {
var gview = $('#Grid').data("kendoGrid");
var selectedItem = gview.dataItem(gview.select());
if (selectedItem == null)
{
alert("Please select one record
");
}
var id = selectedItem .id;
$.get("/EMP/SaveRecord", {id: id, name: 'Success'}, function (data) {
alert(JSON.stringfy(data));
});
});
});

Answers (1)