Skip to main content

Time Regions

You can use Time Regions to highlight specific time frames.

View Example: Highlight Time Intervals

To create a Time Region, add a TimeRegionItem object to the SchedulerControl.TimeRegionItems collection.

<dxsch:SchedulerControl.TimeRegionItems>
    <dxsch:TimeRegionItem
        Start="{x:Static sys:DateTime.Today}" End="{x:Static sys:DateTime.Now}"
        BrushName="{x:Static dxsch:DefaultBrushNames.TimeRegion1Hatch}"
        />
</dxsch:SchedulerControl.TimeRegionItems>

Brushes are used to paint Time Regions. See the Appearance Customization topic for more information.

Specify the TimeRegionItem.ResourceId property to show a Time Region only for a specific resource when the scheduler is grouped.

Use the view’s TimeRegionContentTemplate and TimeRegionContentTemplateSelector properties to display custom content within Time Regions.

The following views support Time Regions:

Recurrent Time Regions

You can create a recurrent Time Region in the same manner as a recurrent appointment. Set the Type property to Pattern and specify the RecurrenceInfo property value.

<dxsch:SchedulerControl.TimeRegionItems>
    <dxsch:TimeRegionItem
        Type ="Pattern"
        Start="1/1/2019 13:00:00" End="1/1/2019 14:00:00"
        RecurrenceInfo="{dxsch:RecurrenceDaily Start='1/1/2019 13:00:00', ByDay=WorkDays}"
        BrushName="{x:Static dxsch:DefaultBrushNames.TimeRegion3Hatch}"
    />
</dxsch:SchedulerControl.TimeRegionItems>

Refer to the Recurrence topic for more information about recurrences.