HeaderPane
Main
Hide
Share Link
Print

DisabledDaysOfWeek Property, SftDateCalendar Object

Defines the days of the week that cannot be selected.

Syntax

Get

C#SftDateDaysConstants Days = object.DisabledDaysOfWeek;
VB.NETDays = object.DisabledDaysOfWeek As SftDateDaysConstants
C++enum SftDateDaysConstants Days = object->DisabledDaysOfWeek;
enum SftDateDaysConstants Days = object->GetDisabledDaysOfWeek();
CHRESULT object->get_DisabledDaysOfWeek(enum SftDateDaysConstants* Days);

Put

C#SftDateDaysConstants object.DisabledDaysOfWeek = Days;
VB.NETobject.DisabledDaysOfWeek = Days As SftDateDaysConstants
C++enum SftDateDaysConstants object->DisabledDaysOfWeek = Days;
void object->PutDisabledDaysOfWeek(enum SftDateDaysConstants Days);
CHRESULT object->put_DisabledDaysOfWeek(enum SftDateDaysConstants Days);

object

A SftDateCalendar object.

Days

Defines the days of the week that cannot be selected.

NameValueDescription
daysSftDateNone0None
daysSftDateSunday1Sunday
daysSftDateMonday2Monday
daysSftDateTuesday4Tuesday
daysSftDateWednesday8Wednesday
daysSftDateThursday16Thursday
daysSftDateFriday32Friday
daysSftDateSaturday64Saturday
daysSftDateWeekend65Saturday and Sunday

Comments

The DisabledDaysOfWeek property defines the days of the week a calendar shows disabled, a combination of SftDateDaysConstants values. The default is daysSftDateNone. The user cannot select disabled days; they are shown in the color DisabledForeColor. p Single days are disabled using special dates (SftDateSpecialDate.Enabled) or the DayFormatting event. A value typed into a date field control is not limited by disabled days; the ValueValidating event can refuse it. p The setting applies to a month calendar control and to the dropdown calendar of a date field control.

Examples

C# View entire sample code

            } else if (sender == checkClearButton) {
                ForEachCalendar(cal => cal.ShowClearButton = checkClearButton.Checked);
            } else if (sender == checkHolidays) {
                SetHolidays(checkHolidays.Checked);
            } else if (sender == checkWeekends) {
                // the DayFormatting event colors the days; RefreshDays asks for them again
                ForEachCalendar(cal => cal.RefreshDays());
            } else if (sender == checkDisableWeekends) {
                ForEachCalendar(cal => cal.DisabledDaysOfWeek = checkDisableWeekends.Checked ? SftDateDaysConstants.daysSftDateWeekend : SftDateDaysConstants.daysSftDateNone);
            } else if (sender == checkRangeSelect) {
                sftCalendar.SelectionMode = checkRangeSelect.Checked ? SftDateSelectionModeConstants.selectionSftDateRange : SftDateSelectionModeConstants.selectionSftDateSingle;
                ShowSelection();
            } else if (sender == checkThisYear) {
                DateTime first = new DateTime(DateTime.Today.Year, 1, 1), last = new DateTime(DateTime.Today.Year, 12, 31);
                ForEachControl(f => {
                    f.MinDate = checkThisYear.Checked ? first : minDate;

VB.NET View entire sample code

        ElseIf sender Is checkClearButton Then
            ForEachCalendar(Sub(cal) cal.ShowClearButton = checkClearButton.Checked)
        ElseIf sender Is checkHolidays Then
            SetHolidays(checkHolidays.Checked)
        ElseIf sender Is checkWeekends Then
            ' the DayFormatting event colors the days; RefreshDays asks for them again
            ForEachCalendar(Sub(cal) cal.RefreshDays())
        ElseIf sender Is checkDisableWeekends Then
            ForEachCalendar(Sub(cal) cal.DisabledDaysOfWeek = If(checkDisableWeekends.Checked, SftDateDaysConstants.daysSftDateWeekend, SftDateDaysConstants.daysSftDateNone))
        ElseIf sender Is checkRangeSelect Then
            sftCalendar.SelectionMode = If(checkRangeSelect.Checked, SftDateSelectionModeConstants.selectionSftDateRange, SftDateSelectionModeConstants.selectionSftDateSingle)
            ShowSelection()
        ElseIf sender Is checkThisYear Then
            Dim first As New Date(Date.Today.Year, 1, 1), last As New Date(Date.Today.Year, 12, 31)
            ForEachControl(Sub(f)
                               f.MinDate = If(checkThisYear.Checked, first, minDate)

See Also SftDateCalendar Object | Object Hierarchy | Validation


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.