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
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.
Thanks a lot!
Regards.
Prolay
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
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.
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
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.
I have now raised a support ticket with ID 648745.
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.
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... :-)
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.
I ave the same problem like Anne,would you help me?
thanks.
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
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 >>
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
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
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.
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