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

Change ToolTip Placement for ScheduleView

1 Answer 66 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 23 Aug 2011, 06:33 PM
We have customized the scheduleview appointment contents such that the default placement of appointment's tooltip covers some of our data.  Is there a way to change the placement of the tooltip so that it does not cover the appointment item?  I see there is a placement setting for Bottom or Right, but I cannot figure out how to set that.

Can we also change the initial delay?  We would like it to wait a little longer before displaying.

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 26 Aug 2011, 10:05 AM
Hello Eric,

RadScheduleView has a ToolTipTemplate property which is responsible for the tooltip of the control. However, if you wish to customize the appearance or placement of the tooltip, you nee to do the following:

- set ToolTipTemplate="{x:Null}" for RadScheduleView
- add your tooltip in the control template of the appointment item; please, note that there is an AppointmentItemVerticalControlTemplate and an AppointmentItemHorizontalControlTemplate

Please, consider the following example:
        <!-- NOTE: The ToolTip style-->
        <ControlTemplate x:Key="MyToolTipTemplate" TargetType="ToolTip">
            <Grid Height="180" Width="330">
                <Border CornerRadius="2" BorderBrush="DarkBlue" Background="#663030A5">
                    <StackPanel Orientation="Horizontal" Margin="10">
                        <TextBlock MaxWidth="200" TextWrapping="Wrap" Text="{Binding Subject}"/>
                    </StackPanel>
                </Border>
            </Grid>
        </ControlTemplate>
          
        <Style x:Key="AppoinmentToolTipStyle" TargetType="ToolTip">
            <Setter Property="Template" Value="{StaticResource MyToolTipTemplate}" />
            <Setter Property="Placement" Value="Bottom" />
        </Style>
          
        <ControlTemplate x:Key="AppointmentItemVerticalControlTemplate" TargetType="telerik:AppointmentItem">
            <Grid x:Name="Root">
                                  
                <!--NOTE: Add a tooltip-->
                <ToolTipService.ToolTip>
                    <ToolTip Style="{StaticResource AppoinmentToolTipStyle}" />
                </ToolTipService.ToolTip>
  
...
  </Grid>
</ControlTemplate>

While in WPF you can use the InitialShowDelay property of the ToolTipService class to control when the tooltip shows up, Silverlight does not provide such property and it is not possible to control the tooltip delay . The option here is to create your own tooltip control or use a third-party tooltip control.

I hope this helps.

All the best,
Dani
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
ScheduleView
Asked by
Eric
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or