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

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