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

CalendarBuilder

Methods

Culture(System.String)

Specifies the culture info used by the Calendar widget.

Parameters

culture - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .Culture("de-DE")
            )

Events(System.Action)

Configures the client-side events.

Parameters

clientEventsAction - System.Action<CalendarEventBuilder>

The client events action.

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Events(events =>
                            events.Select("onSelect")
                        )
            )

Format(System.String)

Sets the date format, which will be used to parse and format the machine date.

Parameters

format - System.String

FooterId(System.String)

FooterId to be used for rendering the footer of the Calendar.

Parameters

id - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .FooterId("widgetFooterId")
            )

Footer(System.String)

Footer template to be used for rendering the footer of the Calendar.

Parameters

footer - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Footer("#= kendo.toString(data, "G") #")
            )

Footer(System.Boolean)

Enable/disable footer.

Parameters

footer - System.Boolean

Example


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

Depth(Kendo.Mvc.UI.CalendarView)

Specifies the navigation depth.

Parameters

depth - CalendarView

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Depth(CalendarView.Month)
            )

Start(Kendo.Mvc.UI.CalendarView)

Specifies the start view.

Parameters

start - CalendarView

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Start(CalendarView.Month)
            )

Selectable(System.String)

Specifies the selection mode.

Parameters

selectable - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Selectable("multiple")
            )

SelectDates(System.Collections.Generic.IList)

Specifies which dates to be selected if multiple selection mode is enabled.

Parameters

selectDates - System.Collections.Generic.IList<DateTime>

MonthTemplateId(System.String)

MonthTemplateId to be used for rendering the cells of the Calendar.

Parameters

id - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateId("widgetMonthTemplateId")
            )

MonthTemplate(System.String)

Templates for the cells rendered in the "month" view.

Parameters

content - System.String

Example


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

MonthTemplate(System.Action)

Configures the content of cells of the Calendar.

Parameters

monthTemplateAction - System.Action<MonthTemplateBuilder>

Example


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

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.String)

Sets the minimal date, which can be selected in the calendar.

Parameters

date - System.String

Max(System.String)

Sets the maximal date, which can be selected in the calendar.

Parameters

date - System.String

Min(System.DateTime)

Sets the minimal date, which can be selected in the calendar

Parameters

date - System.DateTime

Max(System.DateTime)

Sets the maximal date, which can be selected in the calendar

Parameters

date - System.DateTime

WeekNumber(System.Boolean)

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

Parameters

weekNumber - System.Boolean

Value(System.Nullable)

Sets the value of the calendar

Parameters

date - System.Nullable<DateTime>

Value(System.String)

Sets the value of the calendar

Parameters

date - System.String

Selection(System.Action)

Configures the selection settings of the calendar.

Parameters

selectionAction - System.Action<CalendarSelectionSettingsBuilder>

SelectAction settings, which includes Action name and IEnumerable of DateTime objects.

DisableDates(System.Collections.Generic.IEnumerable)

Parameters

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

DisableDates(System.DayOfWeek[])

Specifies the disabled dates in the Calendar widget using a function.

Parameters

days - System.DayOfWeek[]

Example


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

DisableDates(System.String)

Specifies the disabled dates in the Calendar widget using a function.

Parameters

handler - System.String

Example


             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates("disableDates")
            )

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

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

CenturyCellsFormat(Kendo.Mvc.UI.CenturyCellsFormats)

Defines the century cell format.

Parameters

value - CenturyCellsFormats

The value for CenturyCellsFormat

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.

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);  
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

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

AsChildComponent()

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?