We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Update grid record

Hi

Add  records to product grid from search grid..after add records unable to edit  product grid  ( unable to update type)

Edit event not working

    protected void EditEvents_ServerEditRow(object sender, GridEventArgs e)     {

            EditAction(e.EventType, e.Arguments["data"]);

      }




Attachment: new_cc1912b2.rar

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team March 27, 2017 09:40 AM UTC

Hi Pratheep,  
 
We are able to reproduce the problem at our end. Since the data holds the __type property after returning from the Ajax POST, the server handle arguments didn’t recognize them. It is the cause of the problem. So we suggest to either delete this property before binding data to the Grid or else prevent the same in server end. This has been applicable to server events of all the ASP Elements. Refer to the following code example.  
 
           <script type="text/javascript"> 
 
       
               function bindproduct(Productcode, Productname) { 
 
                   $.ajax({ 
                       type: "POST", 
                       url: "workorder.aspx/bindproduct", 
                       datatype: "json", 
                       contentType: "application/json", 
                       data: JSON.stringify({ "Productcode": Productcode, "Productname": Productname }), 
                       success: function (msg) { 
                           for (var i = 0; i < msg.d.length; i++) { 
                               delete msg.d[0].__type; 
                           } 
                           var materialGridObject = $("#ProductGrid").ejGrid('instance'); 
                           alert(materialGridObject); 
                           materialGridObject.dataSource(msg.d);  
 
                       }, 
                   }); 
 
 
 
                 } 
 
 
 
                    </script> 
 
 
 
 
Regards,  
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon