A newer version of this page is available. Switch to the current version.

How to: Create the Scheduler with the DateNavigator

The following example describes how to create a scheduling application with the DateNavigator.

Follow the steps below to complete the task:

  1. Create a new WPF Application project and open the MainWindow.xaml file in the Visual Studio Designer.
  2. Add the SchedulerControl object to your project. You can do this by dragging the SchedulerControl item from the DX.19.1: Scheduling Toolbox tab to the canvas.

    WPFScheduler_DragDropFromToolbox

  3. Right-click the SchedulerControl object and select Layout | Reset All in the context menu to stretch the SchedulerControl so that it fills the entire window.
  1. In the Toolbox, find the DateNavigator in the DX.19.1: Scheduling group and drop it to the canvas.

    DXScheduler_Examples_DateNavigator_Toolbox

  2. Use the DateNavigator.StyleSettings property to associate the DateNavigator with the Scheduler.

    As a result, your XAML code should look as follows:

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <dxsch:SchedulerControl x:Name="scheduler"
            VerticalAlignment="Stretch"
            GroupType="None" />
        <dxe:DateNavigator x:Name="datenavigator"
            Grid.Column="1"
            VerticalAlignment="Stretch">
            <dxe:DateNavigator.StyleSettings>
                <dxsch:SchedulerDateNavigatorStyleSettings Scheduler="{Binding ElementName=scheduler}"
                    CustomizeSpecialDates="SchedulerDateNavigatorStyleSettings_CustomizeSpecialDates"
                    MaxSelectedConsecutiveWeeks="3"
                    MaxSelectedNonConsecutiveDates="5" />
            </dxe:DateNavigator.StyleSettings>
        </dxe:DateNavigator>
    </Grid>
    
  3. The Scheduler with the DateNavigator is now ready. Run the application and see the result.

    DXScheduler_Examples_DateNavigator_Result