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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Example code for latest version to add, edit and delete to sql database

Thread ID:





130122 Apr 23,2017 09:34 PM UTC Apr 24,2017 12:26 PM UTC ASP.NET Web Forms 1
Tags: Gantt
Armand De Lange
Asked On April 23, 2017 09:34 PM UTC


Can you please supply me with code for the latest version of Gantt to add, edit and delete tasks as all the sample code available seems to be for older versions and not working on the latest version (15.1460.0.41)


Jayakumar Duraisamy [Syncfusion]
Replied On April 24, 2017 12:26 PM UTC

Hi Armand, 
Thanks for contacting Syncfusion support. 
We have prepared a Gantt sample to perform add, edit and delete actions with SQL database. It can be achieved by using “ActionComplete” client side event, we will get the updated data as argument and pass the data to the “pageMethod” for perform add, edit & delete operation with SQL table. 
Please refer following code snippet, 
<ej:Gantt ID="container" runat="server" 
ActionComplete="ActionComplete"> </ej:Gantt> 
<asp:ScriptManager runat="server" EnablePageMethods="true"></asp:ScriptManager> 
<script type="text/javascript"> 
        function ActionComplete(args) {             
            if (args.requestType === 'save' && args.addedRecord) { 
                //Newly Added Record is obtained here , which can be updated to database 
                var ganttRecord = args.addedRecord; 
                if (args.addedRecord.parentItem) 
                    ganttRecord["ParentId"] = ganttRecord.parentItem.taskId; 
            } else if (args.requestType === 'delete') { 
                var data = args.data; 
                var ganttRec = data.item; 
                if (data.hasChildRecords) { 
                // To update the database during Outdent,editing,indent,predecessor update operation 
            else if (args.requestType === 'recordUpdate') {                 
                var ganttRec = args.data.item; 
        public static void AddIt(TaskData record) 
            Gantt obj = new Gantt(); 
        public static void UpdateIt(TaskData record) 
            Gantt obj = new Gantt(); 
        public static int DeleteIt(TaskData record) 
            Gantt obj = new Gantt(); 
            return 0; 
We have also prepared a sample using latest version source & dll's for your reference, please find the sample location as below. 
Jayakumar D. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon