This is a migrated thread and some comments may be shown as answers.

Inline Editing on grid is not working

1 Answer 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Håkan
Top achievements
Rank 1
Håkan asked on 05 Oct 2013, 01:19 AM
Hi,
I m using kendo grid to .net web application. In there I used grid with inline editing.
It loads the data and when click edit button , it can edit. But when I click "Update " the its not pass the data to my controller.

Here is my grid.

 function BindGridPurchaseOrder(orderID) {

                        dataSource = new kendo.data.DataSource({
                            transport: {
                                read:  {
                                   url: "../api/Order/GetOrderItemByOrderID?orderID=" + orderID

                                },
                                update:{
                                   
                                   url: "../api/Order/SaveOrUpdateOrderItem",
                                   dataType: "json"
                                },
                                parameterMap: function(options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                }
                            },
                            batch: true,
                            pageSize: 20,
                            schema: {
                                model: {
                                    id: "OrderItemID",
                                    fields: {
                                        OrderItemID: { editable: false, nullable: true },
                                        ProductName: {editable: false, validation: { required: true } },
                                        SellingPrice: {editable: false, type: "number", validation: { required: true, min: 1} },
                                        BuyingPrice: { type: "number",editable: isPreliminary},
                                       
                                        Quantity: {editable: false, type: "number", validation: { min: 0, required: true } }
                                    }
                                },
                                data: "Data",
                                total: "Count"
                            }
                        });

                    $("#PurchaseOrdersGrid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        pageSize: 7,
                        serverPaging: true,
                        columns: [
                            { field: "OrderItemID", title: '<%= Resources.ResourceiChain.ID %>', width: 50 },
                            { field: "ProductName", title:'<%= Resources.ResourceiChain.ProductName %>'  },
                            { field: "Quantity", title:'<%= Resources.ResourceiChain.Quantity %>'  },
                            { field: "SellingPrice", title: '<%= Resources.ResourceiChain.SellingPrice %>' },
                            { field: "BuyingPrice", title: '<%= Resources.ResourceiChain.BuyingPrice %>' },
                             { title: "Action", command: [
                                    {
                                        id: "edit",
                                        name: "edit",
                                        click: OnRowSelect,
                                        template: "<a class='k-button k-grid-edit' href='' style='min-width:16px;'><span class='k-icon k-edit'></span></a>"
                                    },
                                    {
                                        id: "destroy",
                                        name: "destroy",
                                        click: OnRowDelete,
                                        template: "<a class='k-button k-grid-destroy' href='' style='min-width:16px;'><span class='k-icon k-destroy'></span></a>"
                                    }
                                 ]
                            },
                            
                            ],
                        editable: "inline"
                    });    
        }



Here is my server side code..
        [System.Web.Http.AcceptVerbs("GET", "POST")]
        [System.Web.Http.HttpGet]
        [ActionName("SaveOrUpdateOrderItem")]
        public OrderItemDTO SaveOrUpdateOrderItem(OrderItemDTO orderItemDTO)
        {
               return new OrderItemBS().SaveOrUpdateOrderItem(orderItemDTO.OrderItemID, orderItemDTO.OrderID, orderItemDTO.ProductID,  orderItemDTO.Quantity, orderItemDTO.CreatedBy, orderItemDTO.IsPurchaseOrderItem, buyingPrice);
        }


1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 08 Oct 2013, 01:05 PM
Hi,

 
From the provided information it's not clear what is the exact reason for this behavior - could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Håkan
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or