Edit this page

Declaratively

This tutorial will walk you through the common task of populating RadRating with RadRatingItems declaratively.

Here is a regular RadRating declaration:


In order to add rating items you need to use the RadRating's Items property. The Items property is an ItemCollection which contains your RadRatingItems. For example, insert the following lines to the declaration of your RadRating and see how it will change.

<telerik:RadRating x:Name="radRating">
    <telerik:RadRatingItem Content="1" />
    <telerik:RadRatingItem Content="2" />
    <telerik:RadRatingItem Content="3" />
    <telerik:RadRatingItem Content="4" />
    <telerik:RadRatingItem Content="5" />
    <telerik:RadRatingItem Content="6" />
    <telerik:RadRatingItem Content="7" />
    <telerik:RadRatingItem Content="8" />
    <telerik:RadRatingItem Content="9" />
    <telerik:RadRatingItem Content="10" />
</telerik:RadRating>

Consider declaring rating items in XAML instead of adding them by code whenever it's possible. This includes situations when you know what items you need at design time.

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy