Batch Edit

Hello,

Your examples don't show how to commit the Grid batch updates back to the database using code behind?

Your documentation doesn't work and is missing code examples - https://help.syncfusion.com/aspnet/grid/editing?cs-save-lang=1&cs-lang=csharp - its all blank please see link.





1 Reply

KM Kuralarasan Muthusamy Syncfusion Team June 12, 2018 05:25 PM UTC

Hi David, 

Thanks for contacting Syncfusion support. 
 
We have analyzed your query and we found that you want to use BatchURL in your project. Please refer the following code snippet to perform the crud actions in controller side, while using the BatchURL. 

namespace Sample 
{ 
    public partial class _Default : Page 
    { 
 
 
                ...... 
 
        [WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static void BatchUpdate(List<Orders> changed, List<Orders> added, List<Orders> deleted) 
        { 
 
            if (changed != null) 
            { 
                foreach (var temp in changed) 
                { 
                    Orders result = order.Where(o => o.OrderID == temp.OrderID).FirstOrDefault(); 
                    if (result != null) 
                    { 
                        result.OrderID = temp.OrderID; 
                        result.CustomerID = temp.CustomerID; 
                        result.EmployeeID = temp.EmployeeID; 
                        result.Freight = temp.Freight; 
                    } 
                } 
            } 
 
            if (added != null) 
            { 
                foreach (var temp in added) 
                    order.Insert(0, temp); 
            } 
 
            if (deleted != null) 
            { 
                foreach (var temp in deleted) 
                { 
                    Orders result = order.Where(o => o.OrderID == temp.OrderID).FirstOrDefault(); 
                    order.Remove(result); 
                } 
            } 
        } 
 
                  ..... 
 
   } 
} 

We have also prepared the sample with your requirement and that sample can be downloadable from the below link, 


As per your requirement we have logged task to change our help documentation and it will be refreshed in online as soon as possible. 
 
If you need further assistance please get back to us, 

Regards, 
Kuralarasan M. 


Loader.
Up arrow icon