Change the GanttGraphicalView Item and the Timeline.

6 posts, 0 answers
  1. Zacharias Karasavvas
    Zacharias Karasavvas avatar
    17 posts
    Member since:
    Sep 2009

    Posted 07 Apr 2015 Link to this post

    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.

     

     

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 09 Apr 2015 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. John
    John avatar
    2 posts
    Member since:
    Oct 2008

    Posted 16 Apr 2015 in reply to Hristo Merdjanov Link to this post

    Thank you Hristo. I will give it a try and revert if I have any problems
  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 21 Apr 2015 Link to this post

    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.

     
  6. John
    John avatar
    2 posts
    Member since:
    Oct 2008

    Posted 29 Apr 2015 in reply to Hristo Merdjanov Link to this post

    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 ? 

     

  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 30 Apr 2015 Link to this post

    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready