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

Defines the fluent API for configuring the Kendo UI Rating

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class RatingBuilder : WidgetBuilderBase<Rating, RatingBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Rating, RatingBuilder>RatingBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Rating, RatingBuilder>.ToComponent()WidgetBuilderBase<Rating, RatingBuilder>.Expression(string)WidgetBuilderBase<Rating, RatingBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Rating, RatingBuilder>.Name(string)WidgetBuilderBase<Rating, RatingBuilder>.Deferred(bool)WidgetBuilderBase<Rating, RatingBuilder>.HtmlAttributes(object)WidgetBuilderBase<Rating, RatingBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Rating, RatingBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Rating, RatingBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Rating, RatingBuilder>.Render()WidgetBuilderBase<Rating, RatingBuilder>.ToHtmlString()WidgetBuilderBase<Rating, RatingBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Rating, RatingBuilder>.ToClientTemplate()WidgetBuilderBase<Rating, RatingBuilder>.AsModule(bool)WidgetBuilderBase<Rating, RatingBuilder>.ComponentWidgetBuilderBase<Rating, RatingBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the RatingBuilder class.

C#
public RatingBuilder(Rating component)
Parameters:componentRating

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 for Enabled

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

Configures the client-side events.

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

The client events action.

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for HoveredTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder HoveredTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for HoveredTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder HoveredTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for HoveredTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder HoveredTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for HoveredTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

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

The value for ItemTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder ItemTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ItemTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder ItemTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ItemTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder ItemTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ItemTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 RatingLabelSettingsBuilder for the label setting.

Returns:

RatingBuilder

Returns the current instance of 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

Returns the current instance of RatingLabelSettingsBuilder .

The value to which the Rating items will be rendered.

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

The value for Max

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

The value from which the Rating items will be rendered.

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

The value for Min

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for Precision

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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()
Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for Readonly

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

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

The value for SelectedTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder SelectedTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for SelectedTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder SelectedTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for SelectedTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

C#
public RatingBuilder SelectedTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for SelectedTemplate

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for Selection

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for SelectValueOnFocus

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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 for Tooltip

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

Returns the current RatingBuilder instance.

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

Specifies the initial value of the Rating.If a greater value than the max option is used, then the max value will be set.If a value less than the min option is used, then the min value will be set.

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

The value for Value

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

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(int? value)
Parameters:valueint?

The initial value.

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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

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(int value)
Parameters:valueint

The initial value.

Returns:

RatingBuilder

Returns the current RatingBuilder instance.

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