HeaderPane
Main
Hide
Share Link
Print

AllowedViews Property, SftDateCalendar Object

Defines the views the user can switch to.

Syntax

Get

C#SftDateViewsConstants Views = object.AllowedViews;
VB.NETViews = object.AllowedViews As SftDateViewsConstants
C++enum SftDateViewsConstants Views = object->AllowedViews;
enum SftDateViewsConstants Views = object->GetAllowedViews();
CHRESULT object->get_AllowedViews(enum SftDateViewsConstants* Views);

Put

C#SftDateViewsConstants object.AllowedViews = Views;
VB.NETobject.AllowedViews = Views As SftDateViewsConstants
C++enum SftDateViewsConstants object->AllowedViews = Views;
void object->PutAllowedViews(enum SftDateViewsConstants Views);
CHRESULT object->put_AllowedViews(enum SftDateViewsConstants Views);

object

A SftDateCalendar object.

Views

Defines the views the user can switch to.

NameValueDescription
viewsSftDateMonth1Month view
viewsSftDateYear2Year view
viewsSftDateDecade4Decade view
viewsSftDateCentury8Century view
viewsSftDateAll15All views

Comments

The AllowedViews property defines the views of a calendar, a combination of SftDateViewsConstants values. The default is viewsSftDateAll. Clicking the title switches to the next larger allowed view, choosing a month, year or decade in a larger view switches back to the next smaller allowed view. p The smallest allowed view is the one in which the user selects: a calendar with viewsSftDateYear and viewsSftDateDecade selects months, its value being the first day of the month. If no view is allowed, the month view is used. Calendar systems with several eras (the Japanese calendar) offer the month and year views only. p The view a calendar starts with is defined using InitialView. The setting applies to a month calendar control and to the dropdown calendar of a date field control.

Examples

C# View entire sample code

            comboAcross.SelectedIndex = cal.MonthsAcross - 1;
            comboDown.Items.AddRange(new object[] { "1", "2" });
            comboDown.SelectedIndex = cal.MonthsDown - 1;
            comboWeekNumbers.Items.AddRange(new object[] { "None", "Culture rule", "ISO 8601" });
            comboWeekNumbers.SelectedIndex = !cal.ShowWeekNumbers ? 0 : cal.WeekNumberRule == SftDateWeekRuleConstants.weekRuleSftDateISO8601 ? 2 : 1;
            comboFirstDay.Items.AddRange(new object[] { "(Culture)", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" });
            comboFirstDay.SelectedIndex = (int)cal.FirstDayOfWeek;
            comboViews.Items.AddRange(new object[] { "All", "Month and year", "Month only" });
            comboViews.SelectedIndex = Math.Max(0, Array.IndexOf(viewSets, cal.AllowedViews));
            checkTrailing.Checked = cal.ShowTrailingDates;
            checkTodayButton.Checked = cal.ShowTodayButton;
            checkHighlightToday.Checked = cal.HighlightToday;
            checkClearButton.Checked = cal.ShowClearButton;
            checkDropOnFocus.Checked = fieldDate.DropOnFocus;
            checkAutoAdvance.Checked = fieldDate.AutoAdvance;
            checkThemes.Checked = sftCalendar.UseThemes;

VB.NET View entire sample code

        comboAcross.SelectedIndex = cal.MonthsAcross - 1
        comboDown.Items.AddRange(New Object() {"1", "2"})
        comboDown.SelectedIndex = cal.MonthsDown - 1
        comboWeekNumbers.Items.AddRange(New Object() {"None", "Culture rule", "ISO 8601"})
        comboWeekNumbers.SelectedIndex = If(Not cal.ShowWeekNumbers, 0, If(cal.WeekNumberRule = SftDateWeekRuleConstants.weekRuleSftDateISO8601, 2, 1))
        comboFirstDay.Items.AddRange(New Object() {"(Culture)", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"})
        comboFirstDay.SelectedIndex = CInt(cal.FirstDayOfWeek)
        comboViews.Items.AddRange(New Object() {"All", "Month and year", "Month only"})
        comboViews.SelectedIndex = Math.Max(0, Array.IndexOf(viewSets, cal.AllowedViews))
        checkTrailing.Checked = cal.ShowTrailingDates
        checkTodayButton.Checked = cal.ShowTodayButton
        checkHighlightToday.Checked = cal.HighlightToday
        checkClearButton.Checked = cal.ShowClearButton
        checkDropOnFocus.Checked = fieldDate.DropOnFocus
        checkAutoAdvance.Checked = fieldDate.AutoAdvance
        checkThemes.Checked = sftCalendar.UseThemes

C++ View entire sample code

    FillCombo((CComboBox*) GetDlgItem(IDC_BUTTONS), g_buttons, 4, m_Fields[0]->Buttons);
    FillCombo((CComboBox*) GetDlgItem(IDC_BORDER), g_borders, 3, IndexOf(g_borderStyles, 3, m_Fields[0]->BorderStyle));
    FillCombo((CComboBox*) GetDlgItem(IDC_ALIGNMENT), g_alignments, 2, m_Fields[0]->DropDownAlignment);
    FillCombo((CComboBox*) GetDlgItem(IDC_ACROSS), g_across, 3, cal->MonthsAcross - 1);
    FillCombo((CComboBox*) GetDlgItem(IDC_DOWN), g_down, 2, cal->MonthsDown - 1);
    FillCombo((CComboBox*) GetDlgItem(IDC_WEEKNUMBERS), g_weekNumbers, 3,
        cal->ShowWeekNumbers == VARIANT_FALSE ? 0 : cal->WeekNumberRule == weekRuleSftDateISO8601 ? 2 : 1);
    FillCombo((CComboBox*) GetDlgItem(IDC_FIRSTDAY), g_firstDays, 8, cal->FirstDayOfWeek);
    FillCombo((CComboBox*) GetDlgItem(IDC_VIEWS), g_views, 3, IndexOf(g_viewSets, 3, cal->AllowedViews));
    CheckDlgButton(IDC_TRAILING, cal->ShowTrailingDates != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_TODAYBUTTON, cal->ShowTodayButton != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_HIGHLIGHTTODAY, cal->HighlightToday != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_CLEARBUTTON, cal->ShowClearButton != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_DROPONFOCUS, m_Fields[0]->DropOnFocus != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_AUTOADVANCE, m_Fields[0]->AutoAdvance != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(IDC_THEMES, m_Calendar->UseThemes != VARIANT_FALSE ? BST_CHECKED : BST_UNCHECKED);

See Also SftDateCalendar Object | Object Hierarchy | Calendar Layout


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