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

Text in special slots

1 Answer 50 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 08 Dec 2011, 02:33 PM
Hi,

I am using special slots in timeline to mark public holidays etc... Thus I need the possibility to add some detail information to the special slot like adding a text "Independance day". I read in another post that tooltips are not possible in special slots. Is that still true?

So, what I tried to achieve is adding a textblock to my special day style "template" property. This works when I have a fixed text in there, but I am having trouble binding the text to the custom special slot class. As I read in the docs the DataContext of a special slot is of type DecorationBlock. Thus, tried with:

<Helper:CustomSpecialSlotStyleSelector.ExceptionDayStyle>
               <Style TargetType="telerik:HighlightItem" BasedOn="{StaticResource HighlightItemStyle}">
                   <Setter Property="Margin" Value="0,0,0,0" />
                   <Setter Property="Template">
                       <Setter.Value>
                           <ControlTemplate>
                               <Border Background="Red" Opacity="0.5" >
                                   <TextBlock Text="{Binding Slot.Reason}" />
                               </Border>
                           </ControlTemplate>
                       </Setter.Value>
                   </Setter>
               </Style>
           </Helper:CustomSpecialSlotStyleSelector.ExceptionDayStyle>


What am I doing wrong? Maybe, there is another way to add some text to a special block?

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 13 Dec 2011, 10:13 AM
Hi Stefan,

I guess you have custom implementation of the Slot class. That is why I suggest you override the Copy and CopyFrom methods as it is shown here.

Regards,
Rosi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ScheduleView
Asked by
Tim
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or