Setting background color on summary tasks

4 posts, 0 answers
  1. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 06 Sep 2013 Link to this post

    I need to be able to set the background color for summary tasks in my Gantt Diagram. The below code sets the color on the child-tasks fine, see attached screenshot, but how do I change the color for the summary tasks (green ones)?
    ,
    <telerik:RadGanttView.Resources>
        <Style TargetType="telerik:EventContainer">
            <Setter Property="Background" Value="Yellow" />
        </Style>
    </telerik:RadGanttView.Resources>

    Anne
  2. Polya
    Admin
    Polya avatar
    199 posts

    Posted 10 Sep 2013 Link to this post

    Hi Anne Lyon,

    In order to change the background color of the summary tasks you have to change the SummaryContainer style.
    <Style TargetType="telerik:SummaryContainer">
        <Setter Property="Background" Value="Green"/>
    </Style>

    You can find more information on styling and templating the RadGanttView in this article.

    Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

    Regards,
    Polya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 11 Sep 2013 Link to this post

    Thanks,

    That changed the color of the bar of summary bars, but the "start-end tags" on the bars are now strangely enough orange. See the attached screenshot.

    Actually, if I add the tag : <Style TargetType="telerik:SummaryContainer"> without setting any properties, all the summary bars change color to orange.

    How can I set the background color for the whole summary bar including the triangle tags?

  5. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 11 Sep 2013 Link to this post

    Found the answer myself, If I let the SummaryContainer inherit from the SummaryContainerStyle then I get the expected result:

    <telerik:RadGanttView.Resources>
        <Style TargetType="telerik:SummaryContainer" BasedOn="{StaticResource SummaryContainerStyle}">
            <Setter Property="Background" Value="HotPink" />
        </Style>
    </telerik:RadGanttView.Resources>
Back to Top