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

RatingBuilder

Methods

Value(System.Nullable)

Sets the initial value of the Rating. If the initial value is greater than the specified Max() option, the maximum value will be set as initial. If the initial value is less than the specified Min() option, the minimum value will be set as initial.

Parameters

value - System.Nullable<Int32>

The initial value.

Example


                @(Html.Kendo().Rating()
                    .Name("rating")
                    .Value(1)
                )

Value(System.Nullable)

Sets the initial value of the Rating. If the initial value is greater than the specified Max() option, the maximum value will be set as initial. If the initial value is less than the specified Min() option, the minimum value will be set as initial.

Parameters

value - System.Nullable<Double>

The initial value.

Example


                @(Html.Kendo().Rating()
                    .Name("rating")
                    .Value(1)
                )

Min(System.Double)

The value from which the Rating items will be rendered.

Parameters

value - System.Double

The value that configures the min.

Max(System.Double)

The value to which the Rating items will be rendered.

Parameters

value - System.Double

The value that configures the max.

Selection(System.String)

Specifies the selection behavior. The available options are:*continuous - all items, starting from the first one, are marked as selected. *single - a single item is marked as selected.

Parameters

value - System.String

The value that configures the selection.

Precision(System.String)

Specifies the precision with which an item is selected. The available options are:*item - rate by selecting the whole item. *half - rate by selecting half of the item or the whole item.

Parameters

value - System.String

The value that configures the precision.

Tooltip(System.Boolean)

The Rating displays the value of the item through the title attribute when it is hovered.If tooltip is set to false, the widget will not display the value of the items when hovering over them.The tooltips are not visible when the Rating is disabled.

Parameters

value - System.Boolean

The value that configures the tooltip.

Label(System.Boolean)

The Rating displays a label by default that shows the current value out of the max value 3 / 5. If the widget does not have a selected value, the label will not be displayed initially and will be toggled after an item is selected.If label is set to false, the widget will not display the label.

Parameters

enabled - System.Boolean

Enables or disables the label option.

Label(System.Action)

The Rating displays a label by default that shows the current value out of the max value 3 / 5. If the widget does not have a selected value, the label will not be displayed initially and will be toggled after an item is selected.If label is set to false, the widget will not display the label.

Parameters

configurator - System.Action<RatingLabelSettingsBuilder>

The action that configures the label.

SelectValueOnFocus(System.Double)

If the option is set, the widget will automatically select the specified item when the Rating receives focus and no previous value has been set.

Parameters

value - System.Double

The value that configures the selectvalueonfocus.

ItemTemplate(System.String)

Specifies the template which is used for rendering the items of the Rating.

Parameters

value - System.String

The value that configures the itemtemplate.

ItemTemplateId(System.String)

Specifies the template which is used for rendering the items of the Rating.

Parameters

value - System.String

The value that configures the itemtemplate.

ItemTemplateView(System.Web.Mvc.MvcHtmlString)

Specifies the template which is used for rendering the items of the Rating.

Parameters

value - System.Web.Mvc.MvcHtmlString

The value that configures the itemtemplate.

ItemTemplateHandler(System.String)

Specifies the template which is used for rendering the items of the Rating.

Parameters

value - System.String

The value that configures the itemtemplate.

ItemTemplate(Kendo.Mvc.UI.TemplateBuilder)

Specifies the template which is used for rendering the items of the Rating.

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the itemtemplate.

SelectedTemplate(System.String)

Specifies the template which is used for rendering the selected state of the items.

Parameters

value - System.String

The value that configures the selectedtemplate.

SelectedTemplateId(System.String)

Specifies the template which is used for rendering the selected state of the items.

Parameters

value - System.String

The value that configures the selectedtemplate.

SelectedTemplateView(System.Web.Mvc.MvcHtmlString)

Specifies the template which is used for rendering the selected state of the items.

Parameters

value - System.Web.Mvc.MvcHtmlString

The value that configures the selectedtemplate.

SelectedTemplateHandler(System.String)

Specifies the template which is used for rendering the selected state of the items.

Parameters

value - System.String

The value that configures the selectedtemplate.

SelectedTemplate(Kendo.Mvc.UI.TemplateBuilder)

Specifies the template which is used for rendering the selected state of the items.

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the selectedtemplate.

HoveredTemplate(System.String)

Specifies the template which is used for rendering the hovered state of the items.

Parameters

value - System.String

The value that configures the hoveredtemplate.

HoveredTemplateId(System.String)

Specifies the template which is used for rendering the hovered state of the items.

Parameters

value - System.String

The value that configures the hoveredtemplate.

HoveredTemplateView(System.Web.Mvc.MvcHtmlString)

Specifies the template which is used for rendering the hovered state of the items.

Parameters

value - System.Web.Mvc.MvcHtmlString

The value that configures the hoveredtemplate.

HoveredTemplateHandler(System.String)

Specifies the template which is used for rendering the hovered state of the items.

Parameters

value - System.String

The value that configures the hoveredtemplate.

HoveredTemplate(Kendo.Mvc.UI.TemplateBuilder)

Specifies the template which is used for rendering the hovered state of the items.

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the hoveredtemplate.

Enabled(System.Boolean)

If set to false, the Rating will be: disabled and will not allow the user to change its state.; excluded from the tab order and not receiving focus. or will not submit its value if part of a form..

Parameters

value - System.Boolean

The value that configures the enabled.

Readonly(System.Boolean)

If set to true, the Rating will: be in readonly state and will not allow the user to change its state.; be included in the tab order and able to receive focus. or submit data if part of a form..

Parameters

value - System.Boolean

The value that configures the readonly.

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<RatingEventBuilder>

The client events action.

Example


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

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

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>

AsModule(System.Boolean)

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

Parameters

value - System.Boolean

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();
            )

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.

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?