Please provide an Appointment Source

2 posts, 0 answers
  1. Yana
    Yana avatar
    32 posts
    Member since:
    Aug 2011

    Posted 17 Aug 2011 Link to this post

    Hello, I would like to ask how to appropriately provide for an appointment source. I already provided one on my code, but when i ran my application the scheduleview still says "Please provide an Appointment Source." What am I doing wrong?

    Here is my XAML code:

    <Window
      x:Class="Samples.Home"
      Title="WPF Time Keeping System"
      Height="768"
      Width="1366"
         
      mc:Ignorable="d" Loaded="Window_Loaded" WindowState="Normal" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Icon="pack://application:,,,/Sample Project;component/Icons/Computers.ico"  xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView">
        <!--<Window.Resources>
            <telerik:DayViewDefinition x:Key="DayViewDefinition1" />
        </Window.Resources>-->
        <Grid
        Hyperlink.RequestNavigate="OnNavigationRequest">
     
            <tb:TaskbarIcon
          x:Name="MyNotifyIcon"
          IconSource="/Icons/Error.ico"
          ToolTipText="WPF Time Keeping System" Cursor="Arrow">
     
     
                <tb:TaskbarIcon.ContextMenu>
                    <ContextMenu>
     
                        <MenuItem Header="Add Quicktime Entry" Click="MenuItem_Click" Name="AddQuicktimeEntry">
                            <MenuItem.Icon>
                                <Image Source="Images/aqe.jpg"></Image>
                            </MenuItem.Icon>
                        </MenuItem>
     
                        <MenuItem Header="Start Timer" Name="StartTimer">
                            <MenuItem.Icon>
                                <Image Source="Images/starttimer.png"></Image>
                            </MenuItem.Icon>
     
     
                            <MenuItem Header="Start Timer" Click="MenuItem_Click_1" Name="StartTimer2">
                                <MenuItem.Icon>
                                    <Image Source="Images/starttimer.png"></Image>
                                </MenuItem.Icon>
                            </MenuItem>
     
                            <MenuItem Header="End Timer" Click="MenuItem_Click_5" Name="EndTimer">
                                <MenuItem.Icon>
                                    <Image Source="Images/showtimer.png"></Image>
                                </MenuItem.Icon>
                            </MenuItem>
     
                            <MenuItem Header="Show Timer" Click="MenuItem_Click_6" Name="ShowTimer">
                                <MenuItem.Icon>
                                    <Image Source="Images/showtimer.png"></Image>
                                </MenuItem.Icon>
                            </MenuItem>
                        </MenuItem>
     
                        <Separator></Separator>
     
                        <MenuItem Header="Open Time System" Click="MenuItem_Click_3" Name="OpenTimeSystem">
                            <MenuItem.Icon>
                                <Image Source="Images/showtimer.png"></Image>
                            </MenuItem.Icon>
                        </MenuItem>
     
                        <MenuItem Header="Timer" Click="MenuItem_Click_4" Name="Timer">
                            <MenuItem.Icon>
                                <Image Source="Images/timer.png"></Image>
                            </MenuItem.Icon>
                        </MenuItem>
     
                        <MenuItem Header="Windows 7 Gadget" Click="MenuItem_Click_7" Name="Windows7Gadget">
                            <MenuItem.Icon>
                                <Image Source="Images/windows7.png"></Image>
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Exit" Click="MenuItem_Click_2" Name="Exit">
                            <MenuItem.Icon>
                                <Image Source="Images/exit.png"></Image>
                            </MenuItem.Icon>
                        </MenuItem>
                    </ContextMenu>
                </tb:TaskbarIcon.ContextMenu>
     
            </tb:TaskbarIcon>
     
            <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource GridByDayDataSource}}">
                <telerik:RadScheduleView HorizontalAlignment="Left" Margin="23,124,349,53" VerticalAlignment="Top" Name="MonthlyRadSchedule"  AppointmentCreating="MonthlyRadSchedule_AppointmentCreating" AppointmentsSource="{Binding Appointments}">
                    <telerik:RadScheduleView.ViewDefinitions>
                        <!--<my:DayViewDefinition />
                        <my:WeekViewDefinition />-->
                        <my:MonthViewDefinition />
                        <!--<my:TimelineViewDefinition />-->
                    </telerik:RadScheduleView.ViewDefinitions>
                </telerik:RadScheduleView>
     
     
                <telerik:RadCalendar Height="241.5" HorizontalAlignment="Left" Margin="1049,120,0,0" VerticalAlignment="Top" Width="246" />
                <telerik:RadButton Content="Print" Height="30.96" HorizontalAlignment="Left" Margin="1109,382,0,0" VerticalAlignment="Top" Width="145.123" />
                <telerik:RadButton Content="Submit Time" HorizontalAlignment="Left" Margin="1109,431,0,270" Width="145.123" />
     
                <telerik:RadButton Content="View By Day" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="24,35,0,643" FontSize="24" HorizontalAlignment="Left" Width="181" Name="ViewByDay" Click="ViewByDay_Click" />
                <telerik:RadButton Content="View By Week" FontSize="24" HorizontalContentAlignment="Center" Margin="211,35,953,643" VerticalContentAlignment="Center" Name="ViewByWeek" Click="ViewByWeek_Click" />
                <telerik:RadButton Content="View By Month" FontSize="24" HorizontalContentAlignment="Center" Margin="608,35,556,643" VerticalContentAlignment="Center" Name="ViewByMonth" Click="ViewByMonth_Click" />
                <telerik:RadScheduleView HorizontalAlignment="Left" Margin="23,124,349,53" VerticalAlignment="Top" Name="WeekRadSchedule" AppointmentCreating="WeekRadSchedule_AppointmentCreating" AppointmentsSource="{Binding Appointments}">
                    <telerik:RadScheduleView.ViewDefinitions>
                        <!--<my:DayViewDefinition />-->
                        <my:WeekViewDefinition />
                        <!--<my:MonthViewDefinition />-->
                        <!--<my:TimelineViewDefinition />-->
                    </telerik:RadScheduleView.ViewDefinitions>
                </telerik:RadScheduleView>
                <!--<telerik:RadScheduler HorizontalAlignment="Right" Margin="0,120,325,20" Width="995" />-->
     
     
                <telerik:RadTabControl Margin="23,124,349,53" Name="RadTabDaily">
                     
                    <telerik:RadTabItem Header="Sunday" Name="TabSunday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewSunday" Margin="15,13,12,17" AddingNewDataItem="GridViewSunday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                    <telerik:RadTabItem Header="Monday" Name="TabMonday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewMonday" Margin="15,13,12,17" AddingNewDataItem="GridViewMonday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                    </telerik:RadTabItem>
                     
                    <telerik:RadTabItem Header="Tuesday" Name="TabTuesday">
                            <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewTuesday" Margin="15,13,12,17" AddingNewDataItem="GridViewTuesday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                    <telerik:RadTabItem Header="Wednesday" Name="TabWednesday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewWednesday" Margin="15,13,12,17" AddingNewDataItem="GridViewWednesday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                    <telerik:RadTabItem Header="Thursday" Name="TabThursday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewThursday" Margin="15,13,12,17" AddingNewDataItem="GridViewThursday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                    <telerik:RadTabItem Header="Friday" Name="TabFriday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewFriday" Margin="15,13,12,17" AddingNewDataItem="GridViewFriday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                    <telerik:RadTabItem Header="Saturday" Name="TabSaturday">
                        <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}" Name="GridViewSaturday" Margin="15,13,12,17" AddingNewDataItem="GridViewSaturday_AddingNewDataItem">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Customer}" Header="Customer" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" Header="Project" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Task}" Header="Task" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" />
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadTabItem>
                </telerik:RadTabControl>
                 
            </Grid>
        </Grid>
     
    </Window>



    Thanks. Ayana =)

        
  2. George
    Admin
    George avatar
    1332 posts

    Posted 19 Aug 2011 Link to this post

    Hello Yana,

     
    Thank you for contacting us.

    Please, double check that the DataContext is not null and there is Appointments property in the view model - I couldn't find the GridByDayDataSource resource in the code you provided. Also, check whether the Appointments property is a collection with IAppointment items.

    Hope this helps.

    Greetings,
    George
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
Back to Top