HeaderPane
Main
Hide
Share Link
Print

SelectionMode Property, SftCalendar Object

Defines whether one date or a range of dates is selected.

Syntax

Get

C#SftDateSelectionModeConstants Mode = object.SelectionMode;
VB.NETMode = object.SelectionMode As SftDateSelectionModeConstants
C++enum SftDateSelectionModeConstants Mode = object->SelectionMode;
enum SftDateSelectionModeConstants Mode = object->GetSelectionMode();
CHRESULT object->get_SelectionMode(enum SftDateSelectionModeConstants* Mode);

Put

C#SftDateSelectionModeConstants object.SelectionMode = Mode;
VB.NETobject.SelectionMode = Mode As SftDateSelectionModeConstants
C++enum SftDateSelectionModeConstants object->SelectionMode = Mode;
void object->PutSelectionMode(enum SftDateSelectionModeConstants Mode);
CHRESULT object->put_SelectionMode(enum SftDateSelectionModeConstants Mode);

object

A SftCalendar object.

Mode

Defines whether one date or a range of dates is selected.

NameValueDescription
selectionSftDateSingle0One date
selectionSftDateRange1A range of dates

Comments

The SelectionMode property defines whether the control selects one date or a range of dates. The default is selectionSftDateSingle. p In range selection mode, a month calendar control lets the user select a range of days, and a date field control shows and edits two dates, separated by the RangeSeparator text, with a dropdown calendar that selects a range. The Value property returns the first date of the range. The range is retrieved using the RangeStart and RangeEnd properties and set using the SetRange method. p Calendar.MaxRangeDays limits the number of days the user can select. The control raises the RangeChanged event when the selected range changes.

Examples

C# View entire sample code

                info.DateTimeFormat.Calendar = new JapaneseCalendar();
            else if (culture.Calendar == SftDateCalendarTypeConstants.calendarSftDateHebrew)
                info.DateTimeFormat.Calendar = new HebrewCalendar();
            return date.ToString("D", info);
        }

        private void ShowSelection() {
            string text = "Selected: (none)";
            if (sftCalendar.SelectionMode == SftDateSelectionModeConstants.selectionSftDateRange) {
                if (sftCalendar.RangeStart is DateTime) {
                    DateTime start = (DateTime)sftCalendar.RangeStart;
                    DateTime end = sftCalendar.RangeEnd is DateTime ? (DateTime)sftCalendar.RangeEnd : start;
                    text = "Selected: " + FormatLongDate(start) + " - " + FormatLongDate(end);
                }
            } else if (sftCalendar.Value is DateTime)
                text = "Selected: " + FormatLongDate((DateTime)sftCalendar.Value);

VB.NET View entire sample code

        ElseIf culture.Calendar = SftDateCalendarTypeConstants.calendarSftDateHebrew Then
            info.DateTimeFormat.Calendar = New HebrewCalendar()
        End If
        Return value.ToString("D", info)
    End Function

    Private Sub ShowSelection()
        Dim selection As String = "Selected: (none)"
        If sftCalendar.SelectionMode = SftDateSelectionModeConstants.selectionSftDateRange Then
            If TypeOf sftCalendar.RangeStart Is Date Then
                Dim start As Date = CDate(sftCalendar.RangeStart)
                Dim [end] As Date = If(TypeOf sftCalendar.RangeEnd Is Date, CDate(sftCalendar.RangeEnd), start)
                selection = "Selected: " & FormatLongDate(start) & " - " & FormatLongDate([end])
            End If
        ElseIf TypeOf sftCalendar.Value Is Date Then
            selection = "Selected: " & FormatLongDate(CDate(sftCalendar.Value))

See Also SftCalendar Object | Object Hierarchy | Ranges


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