refresh grid after insert gantt chart

i have this gantt chart and i want to refresh my grid table after insert gantt chart 



and this is the code for my gantt chart



and after finish insert gantt chart auto refresh DataResource from grid table


and this is my grid table code





1 Reply

UA Udhayakumar Anand Syncfusion Team May 24, 2023 03:45 AM UTC

Hi Muqaffi,


Greetings from Syncfusion.


To achieve your requirements, we recommend using the dataBound event. This event allows you to refresh the data source of the grid after inserting the Gantt chart. To illustrate this, we have prepared a sample that demonstrates rendering both the Gantt chart and grid on the same page. By utilizing the dataBound event, we pass the Gantt chart's data source to the grid, effectively refreshing the grid's data source.


To further assist you, we have attached the sample code below:



Code Snippet:

/*index.cshtml*/

<script>

    function DataBound(args) {

        var gantt = document.getElementsByClassName('e-gantt')[0].ej2_instances[0];

        var grid = document.getElementById("DefaultFunctionalities").ej2_instances[0];

        grid.dataSource = gantt.dataSource

    }

</script>



Sample Link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/grid_and_gantt_mvc-1781465257


We hope this solution addresses your concern and helps you achieve the desired outcome. If you have any further questions or encounter any difficulties, please don't hesitate to reach out to us.


Regards,

Udhayakumar


Loader.
Up arrow icon