ContentTemplate of TimeRulerMonthViewItem Could not Change Content

2 posts, 0 answers
  1. Lee
    Lee avatar
    6 posts
    Member since:
    Oct 2012

    Posted 07 Jul 2013 Link to this post

    I couldn't to change TimeRulerMonthViewItem.


    Code snippets   below :

     <Window.Resources>
                <Style x:Key="TimeRulerMonthViewItemStyle" TargetType="telerik:TimeRulerMonthViewItem">
                <Setter Property="telerik:StyleManager.Theme" Value="Windows8"/>
                <Setter Property="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="WhyCantChanged"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
         </Style>
            <telerik:OrientedTimeRulerItemStyleSelector x:Key="Origin" 
                                                     MonthViewTickStyle="{StaticResource TimeRulerMonthViewItemStyle}"/>
        </Window.Resources>
    <Grid>
            <telerik:RadScheduleView x:Name="ScheduleView"
                                      telerik:StyleManager.Theme="Windows8" TimeRulerItemStyleSelector="{StaticResource Origin}">
                <telerik:RadScheduleView.Resources>
                    <Style TargetType="telerik:RadButton">
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="I am Mark."/>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </telerik:RadScheduleView.Resources>
                <telerik:RadScheduleView.ViewDefinitions >
                    <telerik:MonthViewDefinition/>
                </telerik:RadScheduleView.ViewDefinitions>
            </telerik:RadScheduleView>
        </Grid>

    It could not change  Content. Do I just have to setting its ControlTemplate ,Only one way? Why not setting ContentTemplate?


  2. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 09 Jul 2013 Link to this post

    Hello Lee,

    In the current implementation of the ScheduleView the ContentTemplate property is not implemented - you should set the content in a custom ControlTemplate. I would suggest you to use the default ControlTemplate as base and modify it as required when creating custom ControlTemplate in order to have the complete functionality of the ScheduleView.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top