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

Custom Tooltip Display

5 Answers 200 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Scott Michetti
Top achievements
Rank 1
Scott Michetti asked on 06 Oct 2011, 05:39 PM
Hello, I'm moving from the Scheduler to the ScheduleView. The following XAML was used in the Scheduler, and worked fine, although for the ScheduleView I changed Occurrence.Appointment to Appointment. The tooltip is no longer displaying correctly. The border color is not there. Also, I'm using a custom tooltip control to extend the duration the tooltip stays up, but the tooltip is only staying up for 7 seconds, which is the silverlight default. What changes can I make to have it work as it did in the Scheduler? If I comment out

<Controls:ToolTipService.ToolTip>

 

<Controls:ToolTip InitialDelay="00:00:00" DisplayTime="00:10:00">

 

then the border displays, but the tip only shows for 7 seconds.

Thanks
Scott


 

 

 

<DataTemplate x:Name="ToolTipTemplate2">

 

 

 

 

<Grid Background="Transparent">

 

 

 

 

<Controls:ToolTipService.ToolTip>

 

 

 

 

<Controls:ToolTip InitialDelay="00:00:00" DisplayTime="00:10:00">

 

 

 

 

<Border Background="{Binding Path=Appointment.Category.CategoryBrush}" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1" >

 

 

 

 

<TextBlock Text="{Binding Path=Appointment, Converter={StaticResource SubjectConverter}}" TextWrapping="Wrap" TextAlignment="Left" FontWeight="Bold" VerticalAlignment="Top" Height="100" Width="285" HorizontalAlignment="Left" Margin="2,2,0,0" />

 

 

 

 

</Border>

 

 

 

 

</Controls:ToolTip>

 

 

 

 

</Controls:ToolTipService.ToolTip>

 

 

 

 

<TextBox x:Name="PART_SubjectTextBox" Margin="7 0 5 0"

 

 

 

VerticalAlignment="Top" HorizontalAlignment="Stretch"

 

 

 

Text="{Binding Path=Appointment.Subject}" IsHitTestVisible="False" Style="{StaticResource AppointmentSubjectTextBox}"

 

 

 

Foreground="Black" TextWrapping="Wrap" Background="Transparent" BorderThickness="0" />

 

 

 

 

</Grid>

 

 

 

 

</DataTemplate>

 


5 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 07 Oct 2011, 08:12 AM
Hi Scott,

The xaml of your tooltip is part of a DataTemplate, which is just a means to present the content of a tooltip. What you are actually doing is trying to place a custom ToolTip inside a regular ToolTip. I believe this is causing the unexpected behavior.

Basically, if you want to simply take advantage of the ToolTipTemplate attached property of RadScheduleView and display the default ToolTip with custom content template only, you would use the template which you posted here.

If you wish to use a custom or a third-party ToolTip however, you will need to override the default one and create your own ToolTip inside the control template of the appointment item. Start off with setting ToolTipTemplate="{x:Null}" on RadScheduleView. Then use the AppointmentStyleSelector and add your custom tooltip to both the horizontal and vertical appointment templates.

I hope this will be helpful in your scenario.

All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Scott Michetti
Top achievements
Rank 1
answered on 15 Nov 2011, 04:00 PM
Hello. I tried working with the AppointmentStyle demo you provide here. http://www.telerik.com/help/silverlight/radscheduleview-styles-and-templates-appointment-style.html#_Using_the_AppointmentStyleSelector_to_style_Appointments
I tried to add the custom tooltip to the folowing section but I get an error. Where would I add my custom tooltip XAML?
<telerik:OrientedAppointmentItemStyleSelector x:Key="ScheduleViewAppointmentStyleSelector">
    <telerik:OrientedAppointmentItemStyleSelector.HorizontalStyle>
       ...

Thanks
Scott
0
Dani
Telerik team
answered on 17 Nov 2011, 04:57 PM
Hello Scott,

Please, find attached a sample which illustrates the described approach for implementing a custom tooltip in appointments. You should add your custom tooltip in both the horizontal and the verical appointment templates which are part of the AppointmentStyleSelector.

I hope the sample will be helpful.  

Greetings,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Scott Michetti
Top achievements
Rank 1
answered on 21 Nov 2011, 10:33 PM
Thanks Dani, but my question remains. Where do I place my xaml? To reitierate. I had the xaml in the Scheduler and it worked fine. I upgraded to the SchedeView and the xaml no longer worked. I tried the AppointmentStyleSelector, but if I place the datatemplate that I used in the Scheduler, I get an error. So where do I place the xaml to get the custom tooltip control to work?
To clarify, what I'm trying to accomplish is to extend the duration of the tooltip display, so I'm using this control http://tooltipservice.codeplex.com/.  Any help will be appreciated.

Thanks
Scott
0
Dani
Telerik team
answered on 22 Nov 2011, 12:44 PM
Hi Scott,

RadScheduler and RadScheduleView are two separate controls and trying to use xaml resources from one into the other will naturally not work.

The xaml mark-up of your custom tooltip in RadScheduleView should be placed in both the horizontal and vertical control templates of the AppointmentItem just as demonstrated in the provided previous sample project.

Namely:
    <ControlTemplate x:Key="AppointmentItemHorizontalControlTemplate" TargetType="telerik:AppointmentItem">
            <Grid x:Name="Root">
                <ToolTipService.ToolTip>
                    <ToolTip>
                        <Grid>
                            <Border Background="LightBlue" MinWidth="100" Margin="-20 -4" Padding="5">
                                <TextBlock Text="{Binding Subject}" />
                            </Border>                           
                        </Grid>
                    </ToolTip>
                </ToolTipService.ToolTip>
  
...
</ControlTemplate>
  
<ControlTemplate x:Key="AppointmentItemVerticalControlTemplate" TargetType="telerik:AppointmentItem">
            <Grid x:Name="Root">
                <ToolTipService.ToolTip>
                    <ToolTip>
                        <Grid>
                            <Border Background="LightBlue" MinWidth="100" Margin="-20 -4" Padding="5">
                                <TextBlock Text="{Binding Subject}" />
                            </Border>
                        </Grid>
                    </ToolTip>
                </ToolTipService.ToolTip>
...
  
</ControlTemplate>

If you are still unable to implement this, please send us a working sample which shows the issue you are experiencing.

I hope this helps.

Greetings,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
ScheduleView
Asked by
Scott Michetti
Top achievements
Rank 1
Answers by
Dani
Telerik team
Scott Michetti
Top achievements
Rank 1
Share this question
or