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

Displaying a tool tip for a slot

7 Answers 231 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 29 Feb 2012, 01:49 AM
How would I go about enabling the tool tip for a slot in the RadScheduleView. I already have a tool tip defined for the appointment, but I need to provide the user with additional information about each slot when they are trying to decide where to make their appointment.

Thank you in advance,

Stephen

7 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 29 Feb 2012, 10:43 AM
Hello Stephen,

Try implementing the SpecialSlotStyleSelector and use a custom HighlightItemStyle for all slots that you wish to display a ToolTip. Add your ToolTip to that style.

You can check the Special and ReadOnly slots example of RadScheduleView in the WPF demos.

I hope this helps.

Kind regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Stephen
Top achievements
Rank 1
answered on 29 Feb 2012, 08:06 PM
Hi Dani,
Thanks for the quick response!

I am using the SpecialSlotStyleSelector like you mentioned. I have included in this reply a scaled down version of what I am trying to accomplish that outlines the issue I am having, but the attach file won't allow m to attach a zip file of the project. I can send it to you if you would like so that you don't have to build up a project yourself. In the mean time you can find the xaml file below from the test project.

Thank you in advance for your time.

Stephen

<UserControl x:Class="ScheduleView.ScheduleViewControl"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:ScheduleView"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
         
        <Style x:Key="SlotBaseStyle" TargetType="{x:Type telerik:HighlightItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderBrush="LightGray"
                                Background="{TemplateBinding Background}">
                            <TextBlock Text="{Binding Path=Slot.Desirability, StringFormat={}{0:p0}}" HorizontalAlignment="Center">
                                 
                            </TextBlock>
                             
                            <!--<Border.ToolTip>
                                <TextBlock Text="{Binding Path=Slot.ToolTip}"/>
                            </Border.ToolTip>-->
                             
                        </Border>                       
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
             
            <Setter Property="ToolTip">
                <Setter.Value>
                    <TextBlock Text="{Binding Path=Slot.ToolTip}"/>
                </Setter.Value>
            </Setter>
 
            <!--<Setter Property="ToolTipService.ToolTip">
                <Setter.Value>
                    <TextBlock Text="{Binding Path=Slot.ToolTip}"/>
                </Setter.Value>
            </Setter>-->
             
        </Style>
         
        <local:SlotSelectorStyle x:Key="SlotStyleSelector">
             
            <local:SlotSelectorStyle.LowDesirability>
                <Style TargetType="{x:Type telerik:HighlightItem}"
                       BasedOn="{StaticResource SlotBaseStyle}">
                    <Setter Property="Background" Value="LightCoral"/>
                </Style>
            </local:SlotSelectorStyle.LowDesirability>
 
            <local:SlotSelectorStyle.MedDesirability>
                <Style TargetType="{x:Type telerik:HighlightItem}"
                       BasedOn="{StaticResource SlotBaseStyle}">
                    <Setter Property="Background" Value="Wheat"/>
                </Style>
            </local:SlotSelectorStyle.MedDesirability>
 
            <local:SlotSelectorStyle.HighDesirability>
                <Style TargetType="{x:Type telerik:HighlightItem}"
                       BasedOn="{StaticResource SlotBaseStyle}">
                    <Setter Property="Background" Value="LightGreen"/>
                </Style>
            </local:SlotSelectorStyle.HighDesirability>
 
        </local:SlotSelectorStyle>
         
         
        <DataTemplate x:Key="AppointmentToolTipTemplate">
            <TextBlock Text="{Binding Path=Appointment.Subject}"/>
        </DataTemplate>
         
    </UserControl.Resources>
    <Grid>
 
 
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <telerik:RadScheduleView x:Name="ApptScheduler"
                                 Grid.Row="0"
                                 AppointmentsSource="{Binding Path=Appts}"
                                 SpecialSlotsSource="{Binding Path=DesSlots}"
                                 SpecialSlotStyleSelector="{StaticResource SlotStyleSelector}"
                                 ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}">
 
            <telerik:RadScheduleView.ViewDefinitions>
 
                <telerik:WeekViewDefinition MajorTickLength="1h"
                                            MinorTickLength="1h"
                                            MinTimeRulerExtent="0"
                                            MaxTimeRulerExtent="700"
                                            VisibleDays="7" />
            </telerik:RadScheduleView.ViewDefinitions>
 
        </telerik:RadScheduleView>
 
    </Grid>
</UserControl>

0
Dani
Telerik team
answered on 02 Mar 2012, 11:54 AM
Hello Stephen,

Upon further ivestigation, I am sorry to say that the desired ToolTip in the HighlightItems is currently not possible. The HighlightItems have its IsHitTestVisble property set to false intentionally and since this is done in code, a customization is not possible.

We have received other requests for implementing the SpecialSlot ToolTips feature, but I am afraid for the time being it is not yet planned.


All the best,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Stephen
Top achievements
Rank 1
answered on 02 Mar 2012, 06:03 PM
Hi Dani,

We really need to have access to this functionality for this tool we are building. How can we go about getting this enabled?

Thank you,

Stephen
0
Dani
Telerik team
answered on 05 Mar 2012, 10:37 AM
Hello Stephen

This feature is not yet implemented and I am afraid there is not any workaround approach to achieving the same result.

Kind regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
paolo30Rose
Top achievements
Rank 1
answered on 28 Dec 2012, 11:30 AM

To solve this create a class

SpecialSlotStyleSelector and overide

 

 

override Style SelectStyle(object item, DependencyObject container, ViewDefinitionBase activeViewDefinition)

{

 

if (item is Slot)

{

 

 

 

container.SetValue(HighlightItem.IsHitTestVisibleProperty, true);

container.SetValue(HighlightItem.ToolTipProperty, "TEST");

 

}

 

return base.SelectStyle(item, container, activeViewDefinition);

}

0
Claire
Top achievements
Rank 1
answered on 06 Nov 2015, 02:27 PM
Yes, that does the trick.
Tags
ScheduleView
Asked by
Stephen
Top achievements
Rank 1
Answers by
Dani
Telerik team
Stephen
Top achievements
Rank 1
paolo30Rose
Top achievements
Rank 1
Claire
Top achievements
Rank 1
Share this question
or