Losing DayViewDefinition after editing template

4 posts, 0 answers
  1. Jean-Sebastien
    Jean-Sebastien avatar
    2 posts
    Member since:
    Feb 2014

    Posted 09 Sep 2014 Link to this post

    Hi,

    I'm trying to apply a custom style on my ScheduleView but when there is a Style="{DynamicResource RadScheduleViewStyle1}" in the RadScheduleView arguments, i am losing the Day, Week, etc in the ScheduleViewHeader.

    I have edited the template of the ScheduleView by right clicking on the scheduleView -> edit Template -> Edit Copy...

    I've put the template in another xaml, ScheduleViewTemplate.xaml.
    There was an error with DraggedItemsSource, but I corrected it with this thread: http://www.telerik.com/forums/custom-appointment-problem-since-3-1116-1040 

    Can you help me to resolve the issue with the ViewDefinitions.
    Thank you

     Here is my MainWindow.xaml:

    <Window x:Class="WpfApplication1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
            Title="MainWindow" Height="550" Width="625">
        <Window.Resources>

            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="ScheduleViewTemplate.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>

        </Window.Resources>
        <Grid>
            <telerik:RadScheduleView x:Name="sv" Height="Auto" Style="{DynamicResource RadScheduleViewStyle1}">
                <telerik:RadScheduleView.ViewDefinitions>
                    <telerik:DayViewDefinition />
                    <telerik:WeekViewDefinition/>
                    <telerik:MonthViewDefinition/>
                    <telerik:TimelineViewDefinition/>
                </telerik:RadScheduleView.ViewDefinitions>
            </telerik:RadScheduleView>
        </Grid>
    </Window>
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 10 Sep 2014 Link to this post

    Hello Jean-Sebastien,

    It seems the generated from Blend template is not complete, that's why I would suggest that you take it from the Telerik controls installation folder instead - the following help topic explains how to achieve this in details:
    Editing Control Templates

    Try it and let us know how it goes.

    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. Jean-Sebastien
    Jean-Sebastien avatar
    2 posts
    Member since:
    Feb 2014

    Posted 13 Sep 2014 in reply to Yana Link to this post

    Thank you for the response.

    I've looked at the code in Telerik.Windows.Controls.ScheduleView.xaml and i realised that the problem was with a ListBox with the xname: ViewModeSelection in the NavigationHeader.

    Therefore, i took this code and paste it over my ViewModeSelection and i now see the two view definitions that i wanted, which is Day and Week.

    Thanks!

    Here is the code of the ListBox

    <ListBox x:Name="ViewModeSelection"
                                            Grid.Column="0"
                                            Style="{StaticResource ViewModeSelectionListBoxStyle}"
                                            SelectionMode="Single"
                                            ItemsSource="{TemplateBinding ViewDefinitions}"
                                            SelectedIndex="{Binding ActiveViewDefinitionIndex, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/> 
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Sep 2014 Link to this post

    Hi Jean-Sebastien,

    Thank you for posting the solution.

    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