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

Change Gantt Task Tooltip

17 Answers 219 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Prolay
Top achievements
Rank 1
Prolay asked on 03 Dec 2012, 09:32 AM
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

17 Answers, 1 is accepted

Sort by
0
Accepted
Masha
Telerik team
answered on 06 Dec 2012, 09:02 AM
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.

0
Prolay
Top achievements
Rank 1
answered on 07 Dec 2012, 07:20 AM
Hi Maria,

Thanks a lot!


Regards.
Prolay
0
Anne Lyon
Top achievements
Rank 1
answered on 10 Jan 2013, 09:45 AM
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
0
Masha
Telerik team
answered on 15 Jan 2013, 08:37 AM
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.

0
Anne Lyon
Top achievements
Rank 1
answered on 15 Jan 2013, 10:15 AM

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

0
Masha
Telerik team
answered on 15 Jan 2013, 11:12 AM
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.

 
0
Anne Lyon
Top achievements
Rank 1
answered on 15 Jan 2013, 11:47 AM
Maria,

I have now raised a support ticket with ID 648745.

Anne
0
Masha
Telerik team
answered on 15 Jan 2013, 03:17 PM
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.

0
Anne Lyon
Top achievements
Rank 1
answered on 16 Jan 2013, 08:29 AM
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... :-)
0
Masha
Telerik team
answered on 16 Jan 2013, 10:40 AM
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.

0
GUO
Top achievements
Rank 1
answered on 05 Dec 2013, 01:18 PM
Hi Maria,

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

thanks.

0
Masha
Telerik team
answered on 10 Dec 2013, 08:19 AM
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 >>
0
Yuriy
Top achievements
Rank 1
answered on 05 Jun 2014, 07:34 PM
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
0
Masha
Telerik team
answered on 06 Jun 2014, 07:42 AM
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.
 
0
Yuriy
Top achievements
Rank 1
answered on 06 Jun 2014, 12:42 PM
Thanks, Masha, that's exactly what I needed! -Yuriy 
0
Jamshed
Top achievements
Rank 1
answered on 16 Jul 2015, 04:15 AM

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.

0
Nasko
Telerik team
answered on 20 Jul 2015, 01:35 PM
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
Tags
GanttView
Asked by
Prolay
Top achievements
Rank 1
Answers by
Masha
Telerik team
Prolay
Top achievements
Rank 1
Anne Lyon
Top achievements
Rank 1
GUO
Top achievements
Rank 1
Yuriy
Top achievements
Rank 1
Jamshed
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or