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

Set HighlightItems Background

2 Answers 20 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
yi
Top achievements
Rank 1
yi asked on 09 Nov 2018, 11:32 AM

Hello,

      I.m using GanttView to display my MS Project and I wish to highlight a critical task by setting the corresponding item's background color to Yellow. I've looked up the documentation and tried the RowHighlightContainer, but that seems only changes the behavior when MouseOver and not working with the highlighted items. By the way, I've already  the critical tasks to HighlightItemSource Property. Any suggestions?

Here's a snippet of my code:

<Style TargetType="telerik:RowHighlightContainer">
    <Setter Property="Background" Value="Yellow" />
</Style>
...
<telerik:RadGanttView x:Name="GanttView" TasksSource="{Binding Tasks}"
                      BorderThickness="1" SelectedItem="{Binding SelectedTask, Mode=TwoWay}"
                      InitialExpandBehavior="{StaticResource InitialExpandBehavior}"
                      HighlightedItemsSource="{Binding HighlightedTasks}" MouseDown="UIElement_OnMouseDown"
                      Margin="0 6 0 0" PixelLength="{Binding PixelLength}" VisibleRange="{Binding VisibleRange}"/>

2 Answers, 1 is accepted

Sort by
0
Accepted
Dinko
Telerik team
answered on 14 Nov 2018, 11:29 AM
Hello yi,

Thank you for the provided code snippet. I have tested this behavior on my side and the items are highlighted as expected. Attached to this reply you can find the project which I used to test your scenario. Can you take a look at this project and let me know if I am missing something from your implementation.

Regards,
Dinko
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
yi
Top achievements
Rank 1
answered on 17 Nov 2018, 03:50 AM

Hi Dinko,

    Much appreciation, your sample works for me and I've solved the problem.

Tags
GanttView
Asked by
yi
Top achievements
Rank 1
Answers by
Dinko
Telerik team
yi
Top achievements
Rank 1
Share this question
or