Custom Tooltip for GanttView

4 posts, 0 answers
  1. Sergey
    Sergey avatar
    4 posts
    Member since:
    Aug 2015

    Posted 25 Sep 2015 Link to this post

    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

  2. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 29 Sep 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sergey
    Sergey avatar
    4 posts
    Member since:
    Aug 2015

    Posted 29 Sep 2015 in reply to Nasko Link to this post

    Thank you. I'll try your solution.
  5. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 30 Sep 2015 Link to this post

    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
Back to Top