Articles in this section
Category / Section

How to set alternative colors for rated SfRatingItems

1 min read

To set alternative colors for rated SfRatingItems use “AlternationCount” property in SfRating. Also in triggers set colors for SfRatingItems using “RatedFill” property depends up on the AlternationIndex of the SfRating.


            <Style TargetType="sf:SfRatingItem">
                    <Trigger Property="sf:SfRating.AlternationIndex" Value="0">
                        <Setter Property="RatedFill" Value="DeepSkyBlue"> </Setter>
                    <Trigger Property="sf:SfRating.AlternationIndex" Value="1">
                        <Setter Property="RatedFill" Value="DeepPink"></Setter>
        <sf:SfRating HorizontalAlignment="Center" VerticalAlignment="Center"  Name="rating"  AlternationCount="2" >


The following screenshot illustrates the output of the above code example

Alternative color for rated SfRating items

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment