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

Kendo UI Rating TagHelper RatingTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("kendo-rating")]
[HtmlTargetElement("rating-editor", ParentTag = "form-item")]
[HtmlTargetElement("rating-editor", ParentTag = "property-grid-item")]
[RestrictChildren("label", new string[] { "item-template", "hovered-template", "selected-template" })]
public class RatingTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IKendoFormEditor, ITemplateComponent

Inheritance: objectTagHelperTagHelperBaseRatingTagHelper

Implements: IKendoFormEditorITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.VerifySettings()TagHelperBase.SerializeTemplates()TagHelperBase.GenerateId(TagHelperOutput)TagHelperBase.CreateHandler(string)TagHelperBase.GetRangeValidationParameter<TValue>(ModelExplorer, string)TagHelperBase.ExtractEditFormat(string)TagHelperBase.ToDictionaryHandler(IDictionary<string, string>)TagHelperBase.AddSelfToTemplate(TagHelperContext)TagHelperBase.ViewContextTagHelperBase.GeneratorTagHelperBase.InitializerTagHelperBase.WriterTagHelperBase.ScriptAttributesTagHelperBase.NameTagHelperBase.IdTagHelperBase.SelectorTagHelperBase.IdPrefixTagHelperBase.IsInClientTemplateTagHelperBase.DeferredTagHelperBase.AsModuleTagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-rating name="rating" min="1" max="6" value="3"></kendo-rating>

Constructors

Initializes a new instance of the RatingTagHelper class.

C#
public RatingTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

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 bool? Enabled { get; set; }

An expression to be evaluated against the current model.

C#
public ModelExpression For { get; set; }

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

C#
public string HoveredTemplate { get; set; }

Specifies the template which is used for rendering the hovered state of the items. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string HoveredTemplateHandler { get; set; }

Specifies the template which is used for rendering the hovered state of the items. This option expects the ID of the script element that contains the template.

C#
public string HoveredTemplateId { get; set; }

Specifies the template which is used for rendering the hovered state of the items. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent HoveredTemplateView { get; set; }

IsNested member.

C#
[HtmlAttributeNotBound]
public bool IsNested { get; set; }

Implements: IKendoFormEditor.IsNested

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

C#
public string ItemTemplate { get; set; }

Specifies the template which is used for rendering the items of the Rating. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string ItemTemplateHandler { get; set; }

Specifies the template which is used for rendering the items of the Rating. This option expects the ID of the script element that contains the template.

C#
public string ItemTemplateId { get; set; }

Specifies the template which is used for rendering the items of the Rating. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent ItemTemplateView { get; set; }

The value to which the Rating items will be rendered.

C#
public double? Max { get; set; }

The value from which the Rating items will be rendered.

C#
public double? Min { get; set; }

The name of the JavaScript function that will handle the change event. Fires when the value of the Rating is changed through user interaction.

C#
public string OnChange { get; set; }

The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the Rating is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public string OnKendoKeydown { get; set; }

The name of the JavaScript function that will handle the select event. Fires when an item is selected through user interaction.

C#
public string OnSelect { get; set; }

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 string Precision { get; set; }

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 bool? Readonly { get; set; }

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

C#
public string SelectedTemplate { get; set; }

Specifies the template which is used for rendering the selected state of the items. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string SelectedTemplateHandler { get; set; }

Specifies the template which is used for rendering the selected state of the items. This option expects the ID of the script element that contains the template.

C#
public string SelectedTemplateId { get; set; }

Specifies the template which is used for rendering the selected state of the items. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent SelectedTemplateView { get; set; }

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 string Selection { get; set; }

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 double? SelectValueOnFocus { get; set; }

Represents a collection of templates defined for the component.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

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 bool? Tooltip { get; set; }

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 double? Value { get; set; }

Methods

Gets the initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

The initialization script.

Overrides: TagHelperBase.GetInitializationScript()

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: TagHelperBase.Serialize()

SerializeEvents method.

C#
protected override Dictionary<string, object> SerializeEvents()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeEvents()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeSettings()

TryAddAsEditor method.

C#
public bool TryAddAsEditor(TagHelperContext context)
Parameters:contextTagHelperContextReturns:

bool

The result.

Implements: IKendoFormEditor.TryAddAsEditor(TagHelperContext)

Writes the HTML output.

C#
protected override void WriteHtml(TagHelperOutput output)
Parameters:outputTagHelperOutput

The TagHelper output.

Overrides: TagHelperBase.WriteHtml(TagHelperOutput)