Back to Devexpress

GanttView.WorkdayRules Property

wpf-devexpress-dot-xpf-dot-gantt-dot-ganttview-70cb0088.md

latest2.1 KB
Original Source

GanttView.WorkdayRules Property

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

Namespace : DevExpress.Xpf.Gantt

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

NuGet Package : DevExpress.Wpf.Gantt

Declaration

csharp
public WorkdayRuleCollection WorkdayRules { get; }
vb
Public ReadOnly Property WorkdayRules As WorkdayRuleCollection

Property Value

TypeDescription
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.

xaml
<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

GanttView Class

GanttView Members

DevExpress.Xpf.Gantt Namespace