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

Percentage calculation problem

Thread ID:





118244 Feb 16,2015 06:09 AM UTC Feb 19,2015 04:20 AM UTC ASP.NET Web Forms 4
Tags: Gantt
Hasan Kosten
Asked On February 16, 2015 06:09 AM UTC

Hello again,

I have a main task, which has 4 subtasks. Each subtask includes one or more items. I'm calculating the percentage in the background as 37.5, putting it to main task, but it shows as 44 as stated in the image attached.

How can I fix this?

Thank you!

Hasan Kosten
Replied On February 16, 2015 06:48 AM UTC

I found the problem. The Gantt chart calculates percentage by looking the day count in a task process. But I want to calculate the percentage myself, by completed jobs and their % in the tasks. How can I accomplish this?

Thank you.

John Rajaram [Syncfusion]
Replied On February 17, 2015 08:34 AM UTC

Hi Hasan,

Thanks for using Syncfusion products.

In the Gantt control, the percentage of the parent task item is calculated based on the duration and percentage of its total child task items, which is the behavior of the Gantt chart. But we would also like to let you know that, you can also customize your percentage value of the parent task item of the Gantt control. We have prepared a workaround sample using “Load” client side event for changing the values of the parent task item.

Please refer the below code snippets for more details.

Code snippets:


<form id="form1" runat="server" onsubmit="return false" style="overflow: hidden; padding:0; margin: 0;height:100%;width:100%;">

<ej:Gantt ID="Gantt" runat="server"




<script type="text/javascript">

function Load(args) {

var totalParentRecords = args.model.parentRecords.length,

parentItems = args.model.parentRecords;

for (var i = 0; i < totalParentRecords; i++) {

if (parentItems[i].taskId == 1)

parentItems[i].status = "50";

if (parentItems[i].taskId == 5)

parentItems[i].status = "56";

if (parentItems[i].taskId == 10)

parentItems[i].status = "46";






We have prepared a sample based on this. Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/118244/GanttTestSamplePercentage-1992491787.zip

Please let us know if you need further assistance on this.

John. R

Hasan Kosten
Replied On February 18, 2015 07:13 PM UTC

Thank you very much for the fast response and the example code. 

I really appreciate your time helping me solve this problem.

John Rajaram [Syncfusion]
Replied On February 19, 2015 04:20 AM UTC

Hi Hasan,
Thanks for the update.

Please let us know, if you require any further assistance on this.


John. R


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