Displaying a tool tip for a slot

8 posts, 0 answers
  1. Stephen
    Stephen avatar
    3 posts
    Member since:
    Dec 2011

    Posted 28 Feb 2012 Link to this post

    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
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 29 Feb 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Stephen
    Stephen avatar
    3 posts
    Member since:
    Dec 2011

    Posted 29 Feb 2012 Link to this post

    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>

  5. Dani
    Admin
    Dani avatar
    848 posts

    Posted 02 Mar 2012 Link to this post

    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 >>
  6. Stephen
    Stephen avatar
    3 posts
    Member since:
    Dec 2011

    Posted 02 Mar 2012 Link to this post

    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
  7. Dani
    Admin
    Dani avatar
    848 posts

    Posted 05 Mar 2012 Link to this post

    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 >>
  8. paolo30Rose
    paolo30Rose avatar
    3 posts
    Member since:
    Sep 2011

    Posted 28 Dec 2012 Link to this post

    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);

    }

  9. Claire
    Claire avatar
    24 posts
    Member since:
    Apr 2015

    Posted 06 Nov 2015 in reply to paolo30Rose Link to this post

    Yes, that does the trick.
Back to Top
UI for WPF is Visual Studio 2017 Ready