Hello,
I am using a ToolTip Template to show some information related to the items in a Timeline control.
I'd like to increase the amount of time that a tooltip remains visible, I am using the property ToolTipService.ShowDuration but when I change its value it seems it doesn't have effect on the time that the tooltip remains visible.
Is there a way achieve this?
Thanks,
Alberto
I am using a ToolTip Template to show some information related to the items in a Timeline control.
I'd like to increase the amount of time that a tooltip remains visible, I am using the property ToolTipService.ShowDuration but when I change its value it seems it doesn't have effect on the time that the tooltip remains visible.
Is there a way achieve this?
Thanks,
Alberto
4 Answers, 1 is accepted
0
Hello Amige,
You should set the TooltipService.ShowDuration property on the object having the Tooltip - in the context of TimeLine these are TimeLineItems. So, in your case you should set it in the InstantItemTemplate and ItemWithDurationTemplate:
You can find them in the attached solution below the <!-- When using implicit styles --> comment.
Please find the sample application attached to this thread.
Regards,
Sia
Telerik
You should set the TooltipService.ShowDuration property on the object having the Tooltip - in the context of TimeLine these are TimeLineItems. So, in your case you should set it in the InstantItemTemplate and ItemWithDurationTemplate:
<
DataTemplate
x:Key
=
"InstantItemTemplate"
>
<
Border
Width
=
"10"
Height
=
"100"
Margin
=
"0,0,0,5"
ToolTipService.ShowDuration
=
"300"
ToolTipService.ToolTip
=
"{Binding DataItem.Date}"
>
<
Rectangle
Height
=
"40"
Width
=
"40"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Fill
=
"Red"
>
</
Rectangle
>
</
Border
>
</
DataTemplate
>
- Another option is to use the same approach but using RadTooltip. You can find it in the attached solution below the <!-- When using RadTooltip --> comment.
- Another option is also to set implicit styles with the needed setters as follows:
<
Style
TargetType
=
"telerik:TimelineInstantItemControl"
BasedOn
=
"{StaticResource TimelineInstantItemControlStyle}"
>
<
Setter
Property
=
"ToolTipService.ShowDuration"
Value
=
"200"
/>
<
Setter
Property
=
"ToolTipService.ToolTip"
Value
=
"ToolTip"
/>
</
Style
>
Please find the sample application attached to this thread.
Regards,
Sia
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Amige
Top achievements
Rank 1
Veteran
answered on 20 Mar 2015, 06:04 PM
Hello Sia,
Thanks for the sample application, it seems pretty easy to implement, but I still can't make it work on my project, let me tell you a little bit about my scenario:
I have a RadTimeline control which has a TimelineItemTemplate and a ToolTipTemplate, something like this:
My TimelineItemTemplate:
In that style is where I am setting the ShowDuration property, but when I run the application it seems that it doesn't work.
Thanks,
Alberto
Thanks for the sample application, it seems pretty easy to implement, but I still can't make it work on my project, let me tell you a little bit about my scenario:
I have a RadTimeline control which has a TimelineItemTemplate and a ToolTipTemplate, something like this:
<
telerik:RadTimeline
x:Name
=
"myTimeline"
PeriodStart
=
"{Binding PeriodStart}"
PeriodEnd
=
"{Binding PeriodEnd}"
VisiblePeriodStart
=
"{Binding VisiblePeriodStart, Mode=TwoWay}"
VisiblePeriodEnd
=
"{Binding VisiblePeriodEnd, Mode=TwoWay}"
StartPath
=
"StartDate"
DurationPath
=
"Duration"
TimelineItemTemplate
=
"{StaticResource myItemTemplate}"
ItemsSource
=
"{Binding myData}"
>
<
telerik:RadTimeline.ToolTipTemplate
>
<
DataTemplate
>
<
Grid
>
<!--Some TextBlocks and Borders to show the information-->
</
Grid
>
</
DataTemplate
>
</
telerik:RadTimeline.ToolTipTemplate
>
</
telerik:RadTimeline
>
My TimelineItemTemplate:
class
CustomTimelineControl : TimelineItemControlBase
{
public
CustomTimelineControl()
{
}
}
<
DataTemplate
x:Key
=
"myItemTemplate"
>
<
controls:CustomTimelineControl
Style
=
"{StaticResource myStyle}"
/>
</
DataTemplate
>
<
Style
x:Key
=
"myStyle"
TargetType
=
"controls:CustomTimelineControl"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"controls:CustomTimelineControl"
>
<
Border
ToolTipService.ShowDuration
=
"2000"
>
<!--Some controls to customize the items-->
</
Border
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
In that style is where I am setting the ShowDuration property, but when I run the application it seems that it doesn't work.
Thanks,
Alberto
0
Accepted
Hello again,
You are right that if you use the exposed TooltipTemplate property of the Timeline control, there is no easy way to manipulate the duration. Please check the attached project and let me know whether setting the template to the items but not the Timeline is appropriate for your solution.
Regards,
Sia
Telerik
You are right that if you use the exposed TooltipTemplate property of the Timeline control, there is no easy way to manipulate the duration. Please check the attached project and let me know whether setting the template to the items but not the Timeline is appropriate for your solution.
Regards,
Sia
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Amige
Top achievements
Rank 1
Veteran
answered on 23 Mar 2015, 08:43 PM
Hello Sia,
Thanks again for the sample project, that works for me.
Regards,
Alberto
Thanks again for the sample project, that works for me.
Regards,
Alberto