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

Defines the fluent API for configuring the Kendo Rating for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the Rating class.

C#
public RatingBuilder(Rating component)
Parameters:componentRating

The component.

Methods

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

C#
public RatingBuilder Enabled(bool value)
Parameters:valuebool

The value that configures the enabled.

Returns:

RatingBuilder

Configures the client-side events.

C#
public RatingBuilder Events(Action<RatingEventBuilder> configurator)
Parameters:configuratorAction<RatingEventBuilder>

The client events action.

Returns:

RatingBuilder

Example:
C#
@( Html.Kendo().Rating()
.Name("Rating")
.Events(events =&gt; events
.Change("onChange")
)
)

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

C#
public RatingBuilder HoveredTemplate(string value)
Parameters:valuestring

The value that configures the hoveredtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder HoveredTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the hoveredtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder HoveredTemplateHandler(string value)
Parameters:valuestring

The value that configures the hoveredtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder HoveredTemplateId(string value)
Parameters:valuestring

The value that configures the hoveredtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder HoveredTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the hoveredtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder ItemTemplate(string value)
Parameters:valuestring

The value that configures the itemtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder ItemTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the itemtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder ItemTemplateHandler(string value)
Parameters:valuestring

The value that configures the itemtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder ItemTemplateId(string value)
Parameters:valuestring

The value that configures the itemtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder ItemTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the itemtemplate.

Returns:

RatingBuilder

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.

C#
public RatingBuilder Label(Action<RatingLabelSettingsBuilder> configurator)
Parameters:configuratorAction<RatingLabelSettingsBuilder>

The action that configures the label.

Returns:

RatingBuilder

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.

C#
public RatingBuilder Label(bool enabled)
Parameters:enabledbool

Enables or disables the label option.

Returns:

RatingBuilder

The value to which the Rating items will be rendered.

C#
public RatingBuilder Max(double value)
Parameters:valuedouble

The value that configures the max.

Returns:

RatingBuilder

The value from which the Rating items will be rendered.

C#
public RatingBuilder Min(double value)
Parameters:valuedouble

The value that configures the min.

Returns:

RatingBuilder

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.

C#
public RatingBuilder Precision(string value)
Parameters:valuestring

The value that configures the precision.

Returns:

RatingBuilder

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

C#
public RatingBuilder Readonly(bool value)
Parameters:valuebool

The value that configures the readonly.

Returns:

RatingBuilder

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

C#
public RatingBuilder SelectedTemplate(string value)
Parameters:valuestring

The value that configures the selectedtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder SelectedTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the selectedtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder SelectedTemplateHandler(string value)
Parameters:valuestring

The value that configures the selectedtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder SelectedTemplateId(string value)
Parameters:valuestring

The value that configures the selectedtemplate.

Returns:

RatingBuilder

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

C#
public RatingBuilder SelectedTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the selectedtemplate.

Returns:

RatingBuilder

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.

C#
public RatingBuilder Selection(string value)
Parameters:valuestring

The value that configures the selection.

Returns:

RatingBuilder

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.

C#
public RatingBuilder SelectValueOnFocus(double value)
Parameters:valuedouble

The value that configures the selectvalueonfocus.

Returns:

RatingBuilder

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.

C#
public RatingBuilder Tooltip(bool value)
Parameters:valuebool

The value that configures the tooltip.

Returns:

RatingBuilder

Specifies 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.

C#
public RatingBuilder Value(double? value)
Parameters:valuedouble?

The initial value.

Returns:

RatingBuilder

Example:
C#
@(Html.Kendo().Rating()
.Name("rating")
.Value(2.5)
)

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.

C#
public RatingBuilder Value(int? value)
Parameters:valueint?

The initial value.

Returns:

RatingBuilder

Example:
C#
@(Html.Kendo().Rating()
.Name("rating")
.Value(1)
)