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

Custom Tooltip for GanttView

3 Answers 168 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 25 Sep 2015, 02:42 PM

Hi, dear support.

I am trying to set a custom tooltip for when the mouse is hovering over Gantt Events.

Here is fragment of my code:

...

 <Grid DataContext="{StaticResource SchedulerViewModel}">
        <controls:RadGanttView x:Name="ganttView"  

            TasksSource="{Binding Tasks}"
            MouseDoubleClick="ganttView_MouseDoubleClick" DataContext="{Binding Tasks}" SelectionChanged="ganttView_SelectionChanged">

            <controls:RadGanttView.Resources>
                <Style TargetType="{x:Type controls:EventContainer}">
                    <Setter Property="Background" Value="{Binding OriginalEvent.Background}"/>
                    <Setter Property="ToolTip" Value="{Binding OriginalEvent.TaskFullDescription}"/>
                </Style>
                
            </controls:RadGanttView.Resources>

...

The class property TaskFullDescription bound to the tooltip provides a string with all task details. The property Background provided in the same class - works and changes the Event container background, but the property TaskFullDescription has no effect and only the default tooltip is shown.

What is the proper way of customising a tooltip, when it needs to set a text provided by a method.  

 

Thank you, Sergey

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 29 Sep 2015, 12:21 PM
Hello Sergey,

In order to achieve the desired appearance of the ToolTip when the mouse hovers over the event you need to modify the default EventContainerStyle. By customizing its EventToolTipTemplate with the desired text the ToolTip should be displayed as needed.

If you need to modify the ToolTip when the task gets dragged or re-sized you need also to modify the GanttDragResizeVisualCueTemplate of the GanttDragResizeVisualCueStyle.

We have created a sample project that demonstrates the described above approach and you could run and evaluate it - please, notice Implicit Styles were used.

Hopes this helps.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sergey
Top achievements
Rank 1
answered on 29 Sep 2015, 04:30 PM
Thank you. I'll try your solution.
0
Nasko
Telerik team
answered on 30 Sep 2015, 07:30 AM
Hello Sergey,

Please, take as much as time as you need to check the proposed approach.

Meanwhile, if you have any additional questions or concerns do not hesitate to contact us.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GanttView
Asked by
Sergey
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or