Articles in this section
Category / Section

How to collapse the built-in editors in appointment editor window in WPF Scheduler (Calendar)

1 min read

In the WPF Scheduler, it is possible to collapse the editors in the scheduler built-in appointment editor window pragmatically with the help of the AppointmentEditorOpening event. By default appointment, all the details of the editors will be displayed in the scheduler appointment editor window.

C#

Using the AppointmentEditorOpening event, set the value for the AppointmentEditorOptions property of the editors that need to collapse or visible pragmatically in the SchedulerAppointmentEditorWindow.

private void OnAppointmentEditorOpening(object sender, AppointmentEditorOpeningEventArgs e)
{
    e.AppointmentEditorOptions = AppointmentEditorOptions.All | (~AppointmentEditorOptions.Background & ~AppointmentEditorOptions.Foreground & ~AppointmentEditorOptions.Reminder & ~AppointmentEditorOptions.Resource);
}

 

Note:

The basic editors such as Subject, Location, Start Hour, and End Hour of the scheduler appointment editor will not be collapsed.

C#
Create a collection of Events for the Scheduler.

public SchedulerViewModel()
{
    this.Events = new ScheduleAppointmentCollection();
    var scheduleAppointment = new ScheduleAppointment()
    {
        StartTime = DateTime.Now,
        EndTime = DateTime.Now.AddHours(1),
        AppointmentBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF339933")),
        Subject = "Conference",
    };
    Events.Add(scheduleAppointment);
}

XAML

Bind the appointments from the view model to a schedule by using the ItemsSource property.

<Window.DataContext>
    <local:SchedulerViewModel/>
</Window.DataContext>
<Grid x:Name="grid">
    <syncfusion:SfScheduler x:Name="schedule"
                            ViewType="Month"
                            ItemsSource="{Binding Events}"
                            >
    </syncfusion:SfScheduler>
    <interactivity:Interaction.Behaviors>
        <local:ScheduleBehavior/>
    </interactivity:Interaction.Behaviors>
</Grid>

View sample in GitHub

Collapse the built-in editors in appointment editor window
Take a moment to pursue the documentation You can also find the options available for the collapse of the built-in appointment editor window in the Schedule.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied