SpecialSlotsSource UI question

4 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 24 Apr 2014 Link to this post

    Hi,

    I'm using the Office2013 theme and I have a question regarding the SpecialSlotsSource. By default the control display horz and vert lines around each slot to seprate them and in our case, we use the SpecialSlotsSource to display some indications in some specials slots. The problem we have is, if we set the time ruler to 15 mins and we set a special slot duration to 30 mins, we lost the line between the two slots coverred by our special slot. I would like to know how I can at least change the color of the special slots to cover the slots without loosing the separator???

    Thank's
    Alain
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 28 Apr 2014 Link to this post

    Hello Alain,

    You just need to customize the SpecialSlotsStyleSelector of the ScheduleView and set the Opacity of the slots to a lower value, thus the lines will be displayed. Here is a quick example with the Office2013 theme:

    <telerik:SpecialSlotStyleSelector x:Key="CustomSpecialSlotStyleSelector">
        <telerik:SpecialSlotStyleSelector.DefaultStyle>
            <Style TargetType="telerik:HighlightItem" BasedOn="{StaticResource HighlightItemStyle}">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="Background" Value="{telerik:Office2013Resource ResourceKey=HighLightBrush}"/>
                <Setter Property="Opacity" Value="0.3"/>
            </Style>
        </telerik:SpecialSlotStyleSelector.DefaultStyle>
        <telerik:SpecialSlotStyleSelector.ReadOnlyStyle>
            <Style TargetType="telerik:HighlightItem" BasedOn="{StaticResource HighlightItemStyle}">
               <Setter Property="BorderThickness" Value="0"/>
               <Setter Property="Background" Value="{telerik:Office2013Resource ResourceKey=InvertedBrush}"/>
               <Setter Property="Opacity" Value="0.3"/>
            </Style>
        </telerik:SpecialSlotStyleSelector.ReadOnlyStyle>
     </telerik:SpecialSlotStyleSelector>

    and then apply the CustomSpecialSlotStyleSelector to the ScheduleView:

    <telerik:RadScheduleView  x:Name="ScheduleView"
        AppointmentsSource="{Binding Appointments}"
        SpecialSlotsSource="{Binding SpecialSlots}"
        SpecialSlotStyleSelector="{StaticResource CustomSpecialSlotStyleSelector}">
        ...
    </telerik:RadScheduleView>

    Hope this helps.

    Regards,
    Yana
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 29 Apr 2014 in reply to Yana Link to this post

    Hi Yana,

    great :) One thing, for each special slots I created, I place a usercontrol inside for binding purpose.With the opacity, the usercontrol itself is affected by the opacity, can you tell me if it's possible to affect only the background of the usercontrol (ie: tranparent) not the content of the usercontrol???

    Thank's
    Alain
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 29 Apr 2014 Link to this post

    Hi Alain,

    You cannot set opacity only to the background - the content will be affected as well. The other option I'd suggest is that you try setting the transparency using alpha channel instead the opacity, please check this article for more details on the approach.

    Regards,
    Yana
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top