I want a kendo UI MVC 4 or 5 c# Grid with Add,Edit,Delete using ajax json and Sqlserver demo curd opeartion.
Any one can help me out..
Here i am using a simple method but it is not working properly..
- <script>
- $(function () {
-
- var dataSource = new kendo.data.DataSource({
- transport: {
- read: {
- url: "@Url.Action("GetAllUsers","Task")",
- dataType: "json"
- },
- update: {
- url: "@Url.Action("Edit","Task")",
- dataType: "json",
- contentType: "application/json;charset=utf-8",
- type:"POST"
- },
- destroy: {
- url: "@Url.Action("Delete","Task")",
- dataType: "json",
- contentType: "application/json;charset=utf-8",
- type:"POST"
- },
- parameterMap: function(data,type)
- {
- return kendo.stringify(data.models);
- }
- },
- schema: {
- model: {
- id: "Id",
- fields: {
- Id: { editable: false },
- UserName: { type: "string" },
- FirstName: { type: "string" },
- LastName: { type: "string" },
- Address: { type: "string" },
- IsActive: { type: "boolean" },
- DateCreated: { type: "date" }
- }
- }
- },
- batch: true,
- pageSize: 20,
- });
-
- $("#allUsers").kendoGrid({
- dataSource:dataSource,
- height: 550,
- groupable: true,
- sortable: true,
- navigatable: true,
- pageable: {
- refresh: true,
- pageSizes: true,
- buttonCount: 5
- },
- columns: [
- { field: "UserName",title: "User Name" },
- { field: "FirstName",title: "First Name" },
- { field: "LastName",title: "Last Name" },
- { field: "Address",title: "Address" },
- { field: "IsActive",title: "Active" },
- { field: "DateCreated",title: "Join Date",format: "{0:dd-MM-yyyy}" },
- { command: "destroy" }
- ],
- toolbar: ["save","cancel"],
- editable: {
- mode: "incell",
- update: true,
- destroy: true,
- confirmation:true
- },
- edit: function (event) {
- console.log("at edit event");
-
- },
- save: function(event)
- {
- console.log("at saveChanges event");
- },
- });
- });
- </script>
So any one can guide me??
Don't send me the link of telerik website..just give me a solutions or code..
I HAVE REFER THIS BLOG:
http://www.mitechdev.com/2016/06/implementing-kendo-grid-with-crud-operations-in-aspnet-mvc.html
i want using json bind inline grid.