Change Gantt Task Tooltip

18 posts, 1 answers
  1. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 03 Dec 2012 Link to this post

    Hi

    I need to customize the gantt task tooltip. I have to remove the time stamp and show short date instead. Can I add other details to the tooltip.

    Please find attached image.


    Regards,
    Prolay
  2. Answer
    Masha
    Admin
    Masha avatar
    355 posts

    Posted 06 Dec 2012 Link to this post

    Hello Prolay,

    You can customize and add any details you want inside Tooltip in RadGanttView.  To show short date format in tooltip you need to customize TextBlock string format inside the template of SummaryContainerStyle:
    <telerik:ToolTipManager.ToolTip>
        <ToolTip>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Start, StringFormat='dd.MM.yyyy'}" TextWrapping="NoWrap" TextTrimming="None" />
                <TextBlock Text=" - " />
                <TextBlock Text="{Binding End, StringFormat='dd.MM.yyyy'}" TextWrapping="NoWrap" TextTrimming="None" />
            </StackPanel>
        </ToolTip>
    </telerik:ToolTipManager.ToolTip>

    Hope this helps.

    Regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 07 Dec 2012 Link to this post

    Hi Maria,

    Thanks a lot!


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

    Posted 10 Jan 2013 Link to this post

    Hi!

    I tried to use the code you suggested, but nothing happens (tooltip remains default)
    My code is as follows:
    <Style TargetType="telerik:SummaryContainer" BasedOn="{StaticResource SummaryContainerStyle}">
        <telerik:ToolTipManager.ToolTip>
            <ToolTip>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Hello - " />
                </StackPanel>
            </ToolTip>
        </telerik:ToolTipManager.ToolTip>
    </Style>

    What am I doing wrong?
    Anne
  6. Masha
    Admin
    Masha avatar
    355 posts

    Posted 15 Jan 2013 Link to this post

    Hello Anne,

    You should modify the tooltip inside SummaryContainerTemplate control template of SummaryContainer Style.

    The attached project demonstrates the approach.

    Kind regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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

    Posted 15 Jan 2013 Link to this post

    Thanks Maria,

    This works, although there was a lot of xaml for such a simple task - is all this necessary?

    I want to show the GantTasks' Description property in the tooltip, not just the start and end dates. It is important for the user to display some more information about the task he is looking at. But if I include the Description it does not show, why?

    <telerik:ToolTipManager.ToolTip>
        <ToolTip>
            <StackPanel Orientation="Horizontal">
                 <TextBlock Text="Description: '" />
                <TextBlock Text="{Binding Description}" TextWrapping="NoWrap" TextTrimming="None" />
                <TextBlock Text="', Date range: " />
                <TextBlock Text="{Binding Start, StringFormat='dd.MM.yyyy'}" TextWrapping="nowrap" TextTrimming="none" />
                <TextBlock Text=" - " />
                <TextBlock Text="{Binding End, StringFormat='dd.MM.yyyy'}" TextWrapping="NoWrap" TextTrimming="None" />
            </StackPanel>
        </ToolTip>
    </telerik:ToolTipManager.ToolTip>

    The task's description is set to : "Hello", but the attached screenshot shows the tooltip only displays and empty string for Description.

    Anne

  8. Masha
    Admin
    Masha avatar
    355 posts

    Posted 15 Jan 2013 Link to this post

    Hi Anne,

    At the moment there is no other way to make modifications of the Tooltip. Can you send me a sample project that reproduces the issue so that I can take a look why binding is not working and quickly help you out.  You should open a support ticket and attach it there.

    All the best,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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

    Posted 15 Jan 2013 Link to this post

    Maria,

    I have now raised a support ticket with ID 648745.

    Anne
  10. Masha
    Admin
    Masha avatar
    355 posts

    Posted 15 Jan 2013 Link to this post

    Hi Anne,

    I've replied in the support ticket,  I am pasting the answer here:

    You should bind to DataItem.Description in order to show the description of GanttTask item. By default the DataContext of  the tooltip is EventProxy type and you need to use DataItem, which holds the real GanttTask item information.

    Kind regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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

    Posted 16 Jan 2013 Link to this post

    Thanks Maria,
    Now I got it to work!
    I so much appreciate you spending time on all my questions, the GanttView is by far the most complex Telerik Control I have come cross. All the others are so easy to use (e.g. TreeView and GridView), but this one is really hard to understand. Hope I can come with more questions as my work progresses... :-)
  12. Masha
    Admin
    Masha avatar
    355 posts

    Posted 16 Jan 2013 Link to this post

    Hi Anne,

    I am happy to hear that you managed to get it work.

    Please let me know if you have any further questions or if I can be of further assistance to you.

    All the best,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  13. GUO
    GUO avatar
    1 posts
    Member since:
    Dec 2013

    Posted 05 Dec 2013 Link to this post

    Hi Maria,

    I ave the same problem like Anne,would you help me?

    thanks.

  14. Masha
    Admin
    Masha avatar
    355 posts

    Posted 10 Dec 2013 Link to this post

    Hello GUO,

    In Anne's case the tooltip text should be bind to OriginalEvent.Description, which holds the whole GanttTask item information. Please review the attached project.

    If you still have issues, please give me more details about the problem you are dealing with?


    Regards,
    Masha
    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 >>
  15. Yuriy
    Yuriy avatar
    9 posts
    Member since:
    Jan 2012

    Posted 05 Jun 2014 in reply to Masha Link to this post

    Hi,

    Thanks for the sample. It really helped. The one missing though - is milestone (diamond) tooltip. Can you post the style container xaml to customize it?

    Thanks,
    -Yuriy
  16. Masha
    Admin
    Masha avatar
    355 posts

    Posted 06 Jun 2014 Link to this post

    Hello Yuriy,

    You need to modify the ControlTemplate of MilestoneContainerStyle in order to show tooltip.

    Please find attached the MilestoneControlTemplate.
    I hope it helps.


    Regards,
    Masha
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  17. Yuriy
    Yuriy avatar
    9 posts
    Member since:
    Jan 2012

    Posted 06 Jun 2014 in reply to Masha Link to this post

    Thanks, Masha, that's exactly what I needed! -Yuriy 
  18. Jamshed
    Jamshed avatar
    4 posts
    Member since:
    Jul 2014

    Posted 15 Jul 2015 Link to this post

    Hi! 

    How can I set the ToolTip in WPF Telerik.RadGanttView's task?

    Now I have the code below:

     <telerik:RadGanttView x:Name="uiGanttView" TasksSource="{Binding Tasks}" ​  >
                <telerik:ToolTipManager.ToolTip>
                    <ToolTip>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding DataItem.Description}" TextWrapping="NoWrap" TextTrimming="None"/>
                            <TextBlock Text="[Minutes:Seconds.Milliseconds]"/>
                        </StackPanel>
                    </ToolTip>
                </telerik:ToolTipManager.ToolTip>​

    But when DataContext of TextBlock is changed, it is GanttView's DataContext not GanttTask and I can't bind to DataItem.

  19. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 20 Jul 2015 Link to this post

    Hello Jamshed,

    You could achieve the desire appearance of the Tooltip by modifying the default one inside the EventContainerTemplate control template of EventContainerStyle as shown below:
    <ControlTemplate x:Key="EventContainerTemplate" TargetType="gantt:EventContainer">
        ...
            <!--set your custom tooltip here-->
            <telerik:ToolTipManager.ToolTip>
                <ToolTip>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding DataItem.Description}" TextWrapping="NoWrap" TextTrimming="None"/>
                            <TextBlock Text="[Minutes:Seconds.Milliseconds]"/>
                        </StackPanel>
                    </StackPanel>
                </ToolTip>
            </telerik:ToolTipManager.ToolTip>
            ...
    </ControlTemplate>
    <Style BasedOn="{StaticResource EventContainerStyle}" TargetType="telerik:EventContainer">
        <Setter Property="Template" Value="{StaticResource EventContainerTemplate}" />
    </Style>

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