Skip to main content
A newer version of this page is available. .

Lesson 2: Specify Scheduler View

  • 2 minutes to read

SchedulerView can use different views to display appointments. A view defines the time interval (for instance, a day view displays one or several days at a time), the user interface elements, and the control’s behavior.

The scheduler stores its views in the Views collection. All standard views with default settings are available out-of-the-box. To overwrite the collection of default views, declare your views in XAML or code.

Open the solution created in Lesson 1 and define a work week view to show medical appointments in the scheduler.

  1. Add a WorkWeekView instance to the scheduler and use the following properties to configure the view:

    Property

    Description

    DayViewBase.TimeScaleInterval

    Gets or sets the interval between two major time tickmarks.

    DayViewBase.TimeScaleSlotCount

    Gets or sets the number of slots (minor time intervals) in a TimeScaleInterval (major time interval).

    SnapToCellsMode

    Gets or sets how the View snaps the scheduler’s appointments.

    ShowWorkTimeOnly

    Gets or sets whether the View should show only WorkTime.

    <dxsch:SchedulerView x:Name="scheduler">
        <dxsch:SchedulerView.DataSource>
            <!-- ... -->
        </dxsch:SchedulerView.DataSource>
        <dxsch:WorkWeekView TimeScaleInterval="01:00:00"
                            TimeScaleSlotCount="4"
                            SnapToCellsMode="Never"
                            ShowWorkTimeOnly="True"/>
    </dxsch:SchedulerView>
    

    Note

    Views is a content property. You can skip property tags in the markup.

  2. Use the following properties of the SchedulerView object to set the scheduler’s initial settings:

    Property

    Description

    Start

    Gets or sets the scheduler start date.

    FirstDayOfWeek

    Gets or sets the day from which the scheduler starts a week.

    WorkDays

    Gets or sets days that form a work week.

    WorkTime

    Gets or sets the work time interval for the Day View, Work Week View and Week View.

    <dxsch:SchedulerView x:Name="scheduler"
                         Start="{Binding StartDate}"
                         FirstDayOfWeek="Monday" 
                         WorkDays="Monday,Tuesday,Wednesday,Friday" 
                         WorkTime="7:00:00-19:00:00">
        <!-- ... -->
    </dxsch:SchedulerView>
    

The scheduler displays appointments in a work week view with the specified settings.

Work Week View

The next lesson explains how to make the scheduler show the Edit Appointment form when an end user taps an appointment.