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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

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

DisableDates(System.String)

Specifies the disabled dates in the Calendar by using a JavaScript function.

Parameters

handler - System.String

The JavaScript function that will set the disabled dates.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates("disableDates")
            )
            <script>
                function disableDates(date) {
                     var disabled = [13, 14, 20, 21];
                     if (date &amp; disabled.indexOf(date.getDate()) > -1 ) {
                         return true;
                     } else return false;
                }
            </script>
             

FooterId(System.String)

Sets the template that renders the Calendar footer.

Parameters

id - System.String

The id of the external Kendo UI template.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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

The value that configures the visibility of the footer.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

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

MonthTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

The value that configures the template.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
                @( Html.Kendo().Calendar()
                           .Name("Calendar")
                           .MonthTemplate(Html.Kendo().Template()
                                    .AddHtml("test")
                            )
                )
             

MonthTemplate(System.Action)

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

Parameters

monthTemplateAction - System.Action<MonthTemplateBuilder>

The action that configures the template settings of the "month" view.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplate(month => month.Content("#= 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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.

RETURNS

Returns the current CalendarBuilder instance.

Example

Razor
 
             @( 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

RETURNS

Returns the current CalendarBuilder instance.

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.

RETURNS

Returns the current CalendarBuilder instance.

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

RETURNS

Returns the current CalendarBuilder instance.

Culture(System.String)

Specifies the culture info used by the widget.

Parameters

value - System.String

The value for Culture

RETURNS

Returns the current CalendarBuilder instance.

Dates(System.DateTime[])

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

Parameters

value - System.DateTime[]

The value for Dates

RETURNS

Returns the current CalendarBuilder instance.

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

RETURNS

Returns the current CalendarBuilder instance.

Format(System.String)

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

Parameters

value - System.String

The value for Format

RETURNS

Returns the current CalendarBuilder instance.

Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

Parameters

value - System.DateTime

The value for Max

RETURNS

Returns the current CalendarBuilder instance.

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.

RETURNS

Returns the current instance of CalendarBuilder .

Min(System.DateTime)

Specifies the minimum date, which the calendar can show.

Parameters

value - System.DateTime

The value for Min

RETURNS

Returns the current CalendarBuilder instance.

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

RETURNS

Returns the current CalendarBuilder instance.

SelectDates(System.DateTime[])

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

Parameters

value - System.DateTime[]

The value for SelectDates

RETURNS

Returns the current CalendarBuilder instance.

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

RETURNS

Returns the current CalendarBuilder instance.

WeekNumber()

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

RETURNS

Returns the current CalendarBuilder instance.

Value(System.DateTime)

Specifies the selected date.

Parameters

value - System.DateTime

The value for Value

RETURNS

Returns the current CalendarBuilder instance.

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.

RETURNS

Returns the current instance of CalendarBuilder .

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

RETURNS

Returns the current CalendarBuilder instance.

Start(Kendo.Mvc.UI.CalendarView)

Parameters

value - CalendarView

The value for Start

RETURNS

Returns the current CalendarBuilder instance.

Depth(Kendo.Mvc.UI.CalendarView)

Specifies the navigation depth.

Parameters

value - CalendarView

The value for Depth

RETURNS

Returns the current CalendarBuilder instance.

CenturyCellsFormat(Kendo.Mvc.UI.CenturyCellsFormats)

Defines the century cell format.

Parameters

value - CenturyCellsFormats

The value for CenturyCellsFormat

RETURNS

Returns the current CalendarBuilder instance.

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<CalendarEventBuilder>

The client events action.

RETURNS

Returns the current CalendarBuilder instance.

Example

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

ToComponent()

Returns the internal view component.

RETURNS

The instance that represents the component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

RETURNS

Returns the current instance.

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

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

RETURNS

Returns the current instance.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

RETURNS

Returns the current instance.

Deferred(System.Boolean)

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

Parameters

deferred - System.Boolean

RETURNS

Returns a DeferredWidgetBuilder instance.

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

RETURNS

Returns the current instance.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

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

The HTML attributes.

RETURNS

Returns the current instance.

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.

RETURNS

Returns the current instance.

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.

RETURNS

Returns the current instance.

Render()

Renders the component in place.

ToHtmlString()

Returns the HTML representation of the component.

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

Parameters

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

ToClientTemplate()

Returns the client template for the component.

AsModule(System.Boolean)

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

Parameters

value - System.Boolean

RETURNS

Returns the current instance.

In this article
PropertiesWriteAction - FuncMethodsDisableDates(System.Collections.Generic.IEnumerable)DisableDates(System.DayOfWeek[])DisableDates(System.String)FooterId(System.String)Footer(System.Boolean)MonthTemplateId(System.String)MonthTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)MonthTemplateHandler(System.String)MonthTemplate(System.String)MonthTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)MonthTemplate(System.Action)Min(System.String)Max(System.String)Value(System.Nullable)Value(System.String)Selection(System.Action)AllowReverse(System.Boolean)AllowReverse()ComponentType(System.String)Culture(System.String)Dates(System.DateTime[])Footer(System.String)Format(System.String)Max(System.DateTime)Messages(System.Action)Min(System.DateTime)Selectable(System.String)SelectDates(System.DateTime[])WeekNumber(System.Boolean)WeekNumber()Value(System.DateTime)Range(System.Action)ShowOtherMonthDays(System.Boolean)Start(Kendo.Mvc.UI.CalendarView)Depth(Kendo.Mvc.UI.CalendarView)CenturyCellsFormat(Kendo.Mvc.UI.CenturyCellsFormats)Events(System.Action)ToComponent()Expression(System.String)Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)Name(System.String)Deferred(System.Boolean)HtmlAttributes(System.Object)HtmlAttributes(System.Collections.Generic.IDictionary)ScriptAttributes(System.Object,System.Boolean)ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)Render()ToHtmlString()WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)ToClientTemplate()AsModule(System.Boolean)
Not finding the help you need?
Contact Support