Scheduler for WinForms | ComponentOne
Scheduler Control / Views / Data Views
In This Topic
    Data Views
    In This Topic

    The C1Schedule control supports different calendar views. There are five predefined data views:

    View Image Description
    DayView Displays a detailed view showing appointments for a particular day.
    TimeLineView Displays appointments in a horizontal time line.
    MonthView Displays appointments for one or more months.
    WeekView

    Displays appointments for specified work days.
    WorkWeekView Displays appointments for any given weekly period. The default is Monday through Friday.

    Changing the default data view

    To change the default data view at design time, set the ViewType property either in the Smart Designer, tasks menu, or in code.

    In the Smart Designer
    1. On the C1Schedule Smart Designer, click the Visual Style button. For more information on accessing the C1Schedule Smart Designer, see C1Schedule Smart Designer.
    2. In the Visual Style dialog box, click the Month View button.
    3. Close the dialog box.
    In the Tasks Menu
    1. Open the C1Schedule Tasks menu. For information accessing the C1Schedule Tasks menu, see C1Schedule Tasks Menu.
    2. Click the drop-down arrow in the Default View drop-down, and select MonthView.
    3. Close the C1Schedule Tasks menu.
    In Code

    Add the following code to set the default ViewType property to TimeLineView:

    C#
    Copy Code
    c1Schedule1.ViewType = ScheduleViewEnum.TimeLineView;
    

    Additionally, when you select more than fourteen days on the calendar, the scheduler automatically switches to WeekView. To prevent this change and retain TimeLineView, add the following code to BeforeViewChange event of the C1Scheduler:

    C#
    Copy Code
    if ((c1Schedule1.ViewType == ScheduleViewEnum.TimeLineView) && !(e.ViewType == ScheduleViewEnum.TimeLineView))
    {
         e.ViewType = ScheduleViewEnum.TimeLineView;
         e.Dates = c1Calendar1.SelectedDates;
    }