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

Insert columns during Load

I have the following fields in my DataSource

5. LoadedValue
6. DefaultDate

Though I am binding all the data in GanttChart, only few of the columns are visible. I would like to add few columns during the load of the control. Is there is any possible way to do this? 

1 Reply

JD Jayakumar Duraisamy Syncfusion Team February 21, 2017 01:26 PM UTC

Hi Mohan Prasath,
Please find the response below,
 In Gantt control, we can add custom columns during load time by using “load” client side event. 
Please refer the following code snippet,
                    load: load,
function load(args) { 
            var columns = this.getColumns(); 
            var isManual = { 
                field: "isManual",  
                headerText: "IsManual",  
                editType: ej.Gantt.EditingType.String, 
            columns.push(isManual);         // Adding Column 1 
            var loadedValue = { 
                field: "loadedValue", 
                headerText: "Loaded Value", 
                editType: ej.Gantt.EditingType.Boolean, 
                visible: false, 
            columns.push(loadedValue);      // Adding Column 2 
            var defaultDate = { 
                field: "defaultDate", 
                headerText: "Default Date", 
               editType: ej.Gantt.EditingType.DatePicker, 
                format: dateFormat 
            columns.push(defaultDate);}            // Adding Column 3
 We have also prepared a sample for your reference, please find the sample in the following link.
Sample: http://jsplayground.syncfusion.com/Sync_xdkyeron
Jayakumar D

Live Chat Icon For mobile
Up arrow icon