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

Losing DayViewDefinition after editing template

3 Answers 60 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jean-Sebastien
Top achievements
Rank 1
Jean-Sebastien asked on 09 Sep 2014, 02:50 PM
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>

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 10 Sep 2014, 06:35 AM
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.
 
0
Jean-Sebastien
Top achievements
Rank 1
answered on 13 Sep 2014, 05:21 AM
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}}"/> 
0
Yana
Telerik team
answered on 15 Sep 2014, 07:21 AM
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.
 
Tags
ScheduleView
Asked by
Jean-Sebastien
Top achievements
Rank 1
Answers by
Yana
Telerik team
Jean-Sebastien
Top achievements
Rank 1
Share this question
or