This is a migrated thread and some comments may be shown as answers.

Customize progressbar of GraphicalViewItem in Ganttview

2 Answers 47 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Sebastiaan
Top achievements
Rank 1
Sebastiaan asked on 17 Jan 2019, 07:19 PM

Hi,

 

Is it possible to change the design of the progressbar in the GraphicalViewItem? I would like to make it a bit bigger and change the color. 

 

thanks!

Sebastiaan

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 18 Jan 2019, 06:34 AM
Hi Sebastiaan,

Thank you for writing.

A possible solution is to handle the GraphicalViewItemFormatting event and access the progress indicator element. Then you can increase its size and change its color. Please check my code snippet below: 
private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
{
    GanttViewTaskItemElement itemElement = e.ItemElement as GanttViewTaskItemElement;
    if (itemElement != null)
    {
        GanttViewTaskElement taskElement = itemElement.TaskElement as GanttViewTaskElement;
        if (taskElement != null)
        {
            taskElement.ProgressIndicatorElement.NumberOfColors = 1;
            taskElement.ProgressIndicatorElement.MinSize = new Size(0, 10);
            taskElement.ProgressIndicatorElement.BackColor = Color.Green;
        }
    }
}

If you need to perform other more complex customizations in the task element, you can create a custom one. The following article demonstrates how this can be achieved: https://docs.telerik.com/devtools/winforms/controls/ganttview/custom-items/task-elements.

I hope this helps. Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sebastiaan
Top achievements
Rank 1
answered on 18 Jan 2019, 09:51 AM
Thank you very much! Exactly what I was looking for!
Tags
GanttView
Asked by
Sebastiaan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Sebastiaan
Top achievements
Rank 1
Share this question
or