Skip to main content

GanttView.WorkdayRules Property

Provides access to a collection of workday rules. This is a dependency property.

Namespace: DevExpress.Xpf.Gantt

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

NuGet Package: DevExpress.Wpf.Gantt

Declaration

public WorkdayRuleCollection WorkdayRules { get; }

Property Value

Type Description
WorkdayRuleCollection

A WorkdayRuleCollection object that represents a collection of workday rules.

Remarks

The GanttControl stores its workday rules within the WorkdayRules collection. This collection provides methods that allow you to add new and remove existing rules. Individual rules are represented by WorkdayRule objects.

Example

The code sample below demonstrates how to define the working and nonworking day rules.

<dxgn:GanttControl ItemsSource="{Binding Tasks}">
    <dxgn:GanttControl.View>
        <dxgn:GanttView
            NonworkingDayDisplayMode="Show"
            NonworkingTimeDisplayMode="Show">
            <dxgn:GanttView.WorkdayRules>
                <dxgn:WorkdayRule IsWorkday="False" Recurrence="{dxgn:Yearly Day=1, Month=1}" />
                <dxgn:WorkdayRule IsWorkday="True" Recurrence="{dxgn:Weekly DayOfWeek=Saturday, Interval=2}" />
            </dxgn:GanttView.WorkdayRules>
        </dxgn:GanttView>
    </dxgn:GanttControl.View>
</dxgn:GanttControl> 
See Also