Label

By default, the Rating displays a label which shows the current out of the max value in the 3 / 5 format.

If the rating does not have a selected value, the label will not be initially displayed and will be toggled after an item is selected.

Rendering the Default Label

The following example demonstrates how to render the default label.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
    )

Customizing the Label

To customize the text of the label, use the Label.TemplateId property. By default, the template automatically receives the value and maxValue in the data object which allows you to use those properties inside the template through the Kendo UI Templates syntax.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
        .Label(l => l.TemplateId("rating-label-template"))
    )

    <script id="rating-label-template" type="text/x-kendo-template">
        <span>
            #: value # out of #: maxValue #
        </span>
    </script>

Disabling the Label

To prevent the label from being displayed, set the Label property to false.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
        .Label(false)
    )

See Also

In this article
Not finding the help you need? Improve this article