GanttView Progress Bar

Posted by: john.morrelles on 26 March 2021, 5:09 am EST

  • Posted 26 March 2021, 5:09 am EST

    A couple of questions on the progress bar, which shows percentage complete.

    I am setting the color of the bar with success using the following code

                Dim bs As BarStyle = gv.GetPredefinedBarStyle(BarType.Progress)
    bs.BarColor = Color.Red
    bs.BarHeight = 40
    gv.Tasks.Search("Task 2").BarStyles.Add(bs)


    The bar height is not changing. Is there a way to adjust the height of the progress part of the bar?

    Is there a way to disable changing the percentage complete by dragging the progress bar? I have percentage complete in the grid set to no allow edits, but the value can still be changed by dragging the progress bar.
  • Replied 29 March 2021, 5:59 pm EST

    Hi John,

    By default, the BarShape of the Progress BarType is MiddleBar that is why when setting the height it is not taken into account because it will remain in the middle of the Main bar.

    If you set the BarType to ThickBar then you can see that the heigh is changing as defined in the BarHeight property.

    >>Is there a way to disable changing the percentage complete by dragging the progress bar?
    No, the percentage completion of the task is calculated based on Start and Finish date so it will change when dragging the bar but you can manipulate the value of percent completion using the BeforeEditTask and AfterEditTask event.

    Please find the attached sample implementing the same.

    Regards,
    Prabhat Sharma.
    ProgressBarDemo.zip
  • Replied 2 April 2021, 2:43 am EST

    Thanks for that, I can undo the progress changes in the edit task events.

    A related issue: When progress percentage isn't visible -- the column isn't visible in the grid portion, it's still possible to click and drag a progress percentage in the gantt bars. Near the left end of the bar, the draggable feature can be either the start date or the progress percentage starting from 0%. It appears to be a pixel to the left or right that determines what is going to be dragged, but it seems to me that if percentage complete isn't a displayed value anywhere in the chart that it shouldn't be draggable.

    Is there a way to suppress the behavior that percentage complete is always available on the gantt bars even when it's not displayed anywhere else?
  • Replied 5 April 2021, 12:35 am EST

    Hello,

    As per our understanding you want to change the percentage change using the Chart Designer and you can do it as shown in the attached GIF.

    >> it's still possible to click and drag a progress percentage in the Gantt bars.
    Yes, it is possible to click and drag a progress percentage in the Gantt bars.

    If there is any other understanding then please let us know.

    Regards,
    Prabhat Sharma.
  • Replied 5 April 2021, 5:35 am EST

    I do not want the percentage complete/progress bar to be modified by drag and drop on the gantt bars at all. Per the earlier response, there's no way to turn it off. However, I've noted that even when percentage complete isn't shown at all in the grid on the left, it's still possible to start a drag and drop operation on percentage complete in the gantt bar from 0% on the left side of the bar.

    Set up your gantt chart so percentage complete isn't displayed. Click and drag from the left side of a gantt bar. Depending on whether you click exactly the right spot, the percentage complete will begin to draw, starting from zero. If percentage complete isn't shown, it shouldn't be possible to drag and drop it at all.
  • Replied 5 April 2021, 8:14 pm EST

    Hello,

    We are discussing this with the developers and will let you know as soon as we get any update on this from their end.
    [Internal Tracking ID: 24697]

    Regards,
    Prabhat Sharma.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels