Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerControl.CustomWorkTime Event

Allows you to specify several custom work time intervals per day, which can be set differently for distinct days and resources.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v24.2.dll

NuGet Package: DevExpress.Wpf.Scheduling

#Declaration

public event CustomWorkTimeEventHandler CustomWorkTime

#Event Data

The CustomWorkTime event's data class is CustomWorkTimeEventArgs. The following properties provide information specific to this event:

Property Description
Interval Gets the time interval for which a work time setting is obtained.
Resource Gets the resource for which a work time setting is obtained.
WorkTime Gets or sets a single work time interval.
WorkTimes Gets or sets a collection of work time intervals.

#Remarks

Handle the CustomWorkTime event and use the CustomWorkTimeEventArgs.Interval and CustomWorkTimeEventArgs.Resource properties to determine the range for which time intervals are specified. Set a single work time interval with the CustomWorkTimeEventArgs.WorkTime property. Use the CustomWorkTimeEventArgs.WorkTimes property to specify several work time intervals.

#Example

This example demonstrates how to use the SchedulerControl.CustomWorkTime event to specify several work time intervals per day, which vary for different days and resources.

WPFScheduler_CustomWorkTime

View Example

<dxsch:SchedulerControl CustomWorkTime="SchedulerControl_CustomWorkTime"
    GroupType="Resource"
    ResourceBrushSchemas="{StaticResource MyResourceSchemas}">
    <dxsch:SchedulerControl.ResourceItems>
        <dxsch:ResourceItem Caption="One" Id="1" />
        <dxsch:ResourceItem Caption="Two" Id="2" />
        <dxsch:ResourceItem Caption="Three" Id="3" />
        <dxsch:ResourceItem Caption="Four" Id="4" />
    </dxsch:SchedulerControl.ResourceItems>
    <dxsch:WeekView x:Name="weekView1"
        ResourcesPerPage="4"
        ShowAllDayArea="False"
        NavigationButtonsVisibility="Never"
        DateHeaderContentTemplate="{StaticResource DateHeaderControl.ContentTemplate}"/>
    <dxsch:TimelineView x:Name="timelineView1"/>
</dxsch:SchedulerControl>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomWorkTime event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also