i am using jquery code to to bind d grid.
$(document).ready(function () {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/Region/GetRegion",
dataType: "json"
},
update: {
url: "/Region/EditRegion",
type: "update",
contentType: "application/json; charset=utf-8",
dataType: "json",
},
destroy: {
url: "/Region/DeleteRegion",
type: "Delete",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
create: {
url: "/Region/NewRegion",
type: "Create",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
parameterMap: function (model, operation) {
//debugger;
if (operation !== "read" && model) {
return kendo.stringify(model);
}
}
},
batch: false,
pageSize: 20,
schema: {
model: {
id: "RegionId",
fields: {
RegionId: { editable: false, nullable: true },
RegionName: { validation: { required: true } },
TenantName: { validation: { required: true } },
PlantName: { validation: { required: true } }
}
}
}
});
$("#Regiongrid").kendoGrid({
dataSource: dataSource,
pageable: true,
cache: false,
height: 430,
toolbar: ["create"],
columns: [
{ field: "RegionId", type: "number", title: "Region Id", width: 10 },
{ field: "RegionName", width: 30, title: "Region Name" },
{ field: "TenantName", width: 100, title: "Tenant Name", attributes: { style: "text-align:left;" } },
{ field: "PlantName", width: 30, title: "Plant Name" },
{ command: ["edit", "destroy"], title: " ", width: "160px" }],
editable: "popup",
});
});