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

Change the GanttGraphicalView Item and the Timeline.

5 Answers 140 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Zacharias Karasavvas
Top achievements
Rank 1
Zacharias Karasavvas asked on 07 Apr 2015, 08:58 AM

Hi ,

I'm trying to change the GanttGraphicalView according to the timeline. For example if a task's duration is for 10 days I want to display the first 8 days for example with Green Color and the 2 that remains with red color. Is this possible and How can I do that in C# code ?

Is this possible ? Take a look a the Capture.PNG file.

Also I want to have a different display in my Gantt View.

The First Header I want to Have the current year(s) depends what I want every time and row below the year to have the Months . But not showing all the days of the month , just only the weeks.

Take a look at the second screenshot(Capture1.PNG).

The Header is the year ,  Below the year are the Months and each month is separated into four weeks.

Is it possible to have a format like that and how using c# ?

Appreciate any help you could give me.

 

 

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 Apr 2015, 04:22 PM
Hello Zacharias,

Thank you for writing.

It is possible to create a RadGanttView as in the pictures you attached, however we do not have it out of the box. We have a kb article explaining in details how a custom GanttViewGraphicalViewElement, similar to the one in your second picture, can be accomplished. Basically would need to substitute the GanttViewGraphicalViewElement and for the purpose you would have to create and inherit several classes, here are the kb and the source code: Indicate Special Days in RadGanttView.

Regarding your other question, I think that you refer to the TaskProgressIndicatorElement. You can change the way it appears as well as the styling of the whole task item by subscribing to the GraphicalViewItemFormatting event. In the code snippet below I am showing you how this can be achieved:
private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
{
    GanttViewTaskItemElement taskItem = e.ItemElement as GanttViewTaskItemElement;
    if (taskItem != null)
    {
        taskItem.TaskElement.BackColor = Color.Red;
        taskItem.TaskElement.BackColor2 = Color.Red;
        taskItem.TaskElement.BackColor3 = Color.Red;
        taskItem.TaskElement.BackColor4 = Color.Red;
 
        GanttViewTaskElement taskElement = taskItem.TaskElement as GanttViewTaskElement;
        if (taskElement != null)
        {
            taskElement.ProgressIndicatorElement.MinSize = new Size(0, 19);
            taskElement.ProgressIndicatorElement.BackColor = Color.Green;
            taskElement.ProgressIndicatorElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        }
    }
}

I am also sending you a screenshot of the result on my side.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
John
Top achievements
Rank 1
answered on 16 Apr 2015, 12:05 PM
Thank you Hristo. I will give it a try and revert if I have any problems
0
Hristo
Telerik team
answered on 21 Apr 2015, 06:34 AM
Hello John,

I hope that the provided solution will be useful. Feel free to modify it in any way you like in order to accomplish your task.

Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
John
Top achievements
Rank 1
answered on 29 Apr 2015, 08:27 AM

Hi Hristo ,

From your article you have provided 

http://www.telerik.com/support/kb/winforms/details/indicate-special-days-in-radganttview

I cannot donwload the zip file. Can you attach it in your post reply ? Is it missing ? 

 

0
Hristo
Telerik team
answered on 30 Apr 2015, 01:29 PM
Hello John,

Sorry to hear that you are experiencing difficulties downloading the project. It is available on the link I sent you, and I am not sure why you were unable to download it. Now I am attaching it to this post.

Should you have further questions please do not hesitate to write back.
 
Regards,
Hristo Merdjanov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
GanttView
Asked by
Zacharias Karasavvas
Top achievements
Rank 1
Answers by
Hristo
Telerik team
John
Top achievements
Rank 1
Share this question
or