Back to Devexpress

WeekDaysCheckEdit Class

windowsforms-devexpress-dot-xtrascheduler-dot-ui-227cde35.md

latest3.8 KB
Original Source

WeekDaysCheckEdit Class

The control that allows users to select days of the week by checking the corresponding boxes.

Namespace : DevExpress.XtraScheduler.UI

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
[ComVisible(false)]
[DXLicenseWinForms]
public class WeekDaysCheckEdit :
    XtraUserControl,
    ISupportInitialize,
    IBatchUpdateable,
    IBatchUpdateHandler,
    IXtraResizableControl
vb
<ComVisible(False)>
<DXLicenseWinForms>
Public Class WeekDaysCheckEdit
    Inherits XtraUserControl
    Implements ISupportInitialize,
               IBatchUpdateable,
               IBatchUpdateHandler,
               IXtraResizableControl

Remarks

Use the WeekDaysCheckEdit.FirstDayOfWeek property to specify the control’s initial settings.

When the user makes changes, the control fires the WeekDaysCheckEdit.WeekDaysChanged event. Use the WeekDaysCheckEdit.WeekDays property to obtain the combination of checked weekdays.

Enable the WeekDaysCheckEdit.UseAbbreviatedDayNames option to shorten names of the weekdays.

Example

This example shows how to update the days in a workweek based on days selected in the WeekDaysCheckEdit control.

csharp
using DevExpress.XtraScheduler;

private void weekDaysCheckEdit1_WeekDaysChanged(object sender, EventArgs e) {
    WeekDays weekDays = this.weekDaysCheckEdit1.WeekDays;
    WorkDaysCollection workDays = this.schedulerControl.WorkDays;
    workDays.BeginUpdate();
    workDays.Clear();
    if(!weekDays.Equals((WeekDays)0))
        workDays.Add(new WeekDaysWorkDay(weekDays));
    workDays.EndUpdate();
}
vb
Imports DevExpress.XtraScheduler

Private Sub weekDaysCheckEdit1_WeekDaysChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim weekDays As WeekDays = Me.weekDaysCheckEdit1.WeekDays
    Dim workDays As WorkDaysCollection = Me.schedulerControl.WorkDays
    workDays.BeginUpdate()
    workDays.Clear()
    If Not weekDays.Equals(CType(0, WeekDays)) Then
        workDays.Add(New WeekDaysWorkDay(weekDays))
    End If
    workDays.EndUpdate()
End Sub

Implements

IXtraResizableControl

Inheritance

Object MarshalByRefObject Component Control ScrollableControl ContainerControl UserControl XtraUserControl WeekDaysCheckEdit

See Also

WeekDaysCheckEdit Members

DevExpress.XtraScheduler.UI Namespace