New to Telerik UI for ASP.NET Core? Download free 30-day trial

CalendarBuilder

Properties

WriteAction - Func

Methods

DisableDates(System.Collections.Generic.IEnumerable)

Specifies the disabled dates in the Calendar component.

Parameters

disableDates - System.Collections.Generic.IEnumerable<String>

The array of dates that must be disabled.

Example


             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates(new string[]{ "we", "th" })
            )

DisableDates(System.DayOfWeek[])

Specifies the disabled dates in the Calendar component as an array of DayOfWeek enums.

Parameters

days - System.DayOfWeek[]

The array of DayOfWeek enums.

Example


             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates(DayofWeek.Saturday, DayOfWeek.Sunday)
            )

DisableDates(System.String)

Parameters

handler - System.String

FooterId(System.String)

Sets the template that renders the Calendar footer.

Parameters

id - System.String

The id of the external Kendo UI template.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .FooterId("footer-template")
            )
            <script id="footer-template" type="text/x-kendo-template">
                Today - #: kendo.toString(data, "d") #
            </script>

Footer(System.Boolean)

Enables the Calendar footer. If set to 'false', the footer will not be displayed.

Parameters

footer - System.Boolean

The value that configures the visibility of the footer.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Footer(false)
            )

MonthTemplateId(System.String)

Sets the template that renders the cells in the 'month' view.

Parameters

id - System.String

The id of the external Kendo UI template.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateId("cell-template")
            )
            <script id="cell-template" type="text/x-kendo-template">
              <div class="#= data.value < 10 ? 'exhibition' : 'party' #">
                  #= data.value #
              </div>
            </script>

MonthTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

Sets the template that renders the cells in the 'month' view.

Parameters

templateView - Microsoft.AspNetCore.Html.IHtmlContent

The Razor View that will be used for rendering the cells content in the 'month' view.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateView(Html.Partial("MonthTemplateView"))
            )

MonthTemplateHandler(System.String)

Sets the template that renders the cells in the 'month' view.

Parameters

templateHandler - System.String

The JavaScript function that will return the content of the cells in the 'month' view.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateHandler("monthTemplate")
            )
            <script>
               function monthTemplate(data) {
                    if(data.value < 10) {
                        return 'exhibition';
                    }
                    return 'party';
                }
            </script>

MonthTemplate(System.String)

Sets the template that renders the cells in the 'month' view.

Parameters

content - System.String

The value that configures the template.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplate("#= data.value #")
            )

Min(System.String)

Sets the minimum date that can be selected in the Calendar.

Parameters

date - System.String

The value that configures minimum date.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Min("01/01/2024")
            )

Max(System.String)

Sets the maximum date that can be selected in the Calendar.

Parameters

date - System.String

The value that configures maximum date.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Max("12/01/2024")
            )

Value(System.Nullable)

Sets the selected date in the Calendar.

Parameters

date - System.Nullable<DateTime>

The DateTime value that sets the selected date.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Value(new DateTime(2024,07,05))
            )

Value(System.String)

Sets the selected date in the Calendar.

Parameters

date - System.String

The value that sets the selected date.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Value("2024/07/05")
            )

Selection(System.Action)

Configures the selection settings of the Calendar.

Parameters

selectionAction - System.Action<CalendarSelectionSettingsBuilder>

The action that configures the selection settings.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Selection(s => s.Action("Save", "Home", new { id = "123" }).Dates(new List<DateTime>(){new DateTime(2024,1,4), new DateTime(2024,1,5)}))
            )

AllowReverse(System.Boolean)

Enables the user to select an end date that is before the start date. This option is available only when the selectable configuration is set to range.

Parameters

value - System.Boolean

The value for AllowReverse

AllowReverse()

Enables the user to select an end date that is before the start date. This option is available only when the selectable configuration is set to range.

ComponentType(System.String)

Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..

Parameters

value - System.String

The value for ComponentType

Culture(System.String)

Specifies the culture info used by the widget.

Parameters

value - System.String

The value for Culture

Dates(System.DateTime[])

Specifies a list of dates, which will be passed to the month template.

Parameters

value - System.DateTime[]

The value for Dates

Footer(System.String)

The template which renders the footer. If false, the footer will not be rendered.

Parameters

value - System.String

The value for Footer

Format(System.String)

Specifies the format, which is used to parse value set with value() method.

Parameters

value - System.String

The value for Format

Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

Parameters

value - System.DateTime

The value for Max

Messages(System.Action)

Allows localization of the strings that are used in the widget.

Parameters

configurator - System.Action<CalendarMessagesSettingsBuilder>

The configurator for the messages setting.

Min(System.DateTime)

Specifies the minimum date, which the calendar can show.

Parameters

value - System.DateTime

The value for Min

Selectable(System.String)

By default user is able to select a single date. The property can also be set to multiple or range. More information about the different selection modes can be found in the Selection article.

Parameters

value - System.String

The value for Selectable

SelectDates(System.DateTime[])

Specifies which dates to be selected when the calendar is initialized.

Parameters

value - System.DateTime[]

The value for SelectDates

WeekNumber(System.Boolean)

If set to true a week of the year will be shown on the left side of the calendar.

Parameters

value - System.Boolean

The value for WeekNumber

WeekNumber()

If set to true a week of the year will be shown on the left side of the calendar.

Value(System.DateTime)

Specifies the selected date.

Parameters

value - System.DateTime

The value for Value

Range(System.Action)

Specifies an initial range selection. This option is available only when the selectable configuration is set to range.

Parameters

configurator - System.Action<CalendarRangeSettingsBuilder>

The configurator for the range setting.

ShowOtherMonthDays(System.Boolean)

When this configuration is enabled, the calendar will render days from the previous and next months in the current view.

Parameters

value - System.Boolean

The value for ShowOtherMonthDays

Start(Kendo.Mvc.UI.CalendarView)

Parameters

value - CalendarView

The value for Start

Depth(Kendo.Mvc.UI.CalendarView)

Specifies the navigation depth.

Parameters

value - CalendarView

The value for Depth

MonthTemplate(System.Action)

Parameters

configurator - System.Action<CalendarMonthTemplateSettingsBuilder>

The configurator for the monthtemplate setting.

CenturyCellsFormat(Kendo.Mvc.UI.CenturyCellsFormats)

Defines the century cell format.

Parameters

value - CenturyCellsFormats

The value for CenturyCellsFormat

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<CalendarEventBuilder>

The client events action.

Example


            @(Html.Kendo().Calendar()
                  .Name("Calendar")
                  .Events(events => events
                      .Change("onChange")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean
In this article
Not finding the help you need?