We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set various heights between SfRatingItems?

Platform: WPF |
Control: SfRating

The SfRating control enables to change the height of the SfRatingItem. The following code enables SfRating control having items with different heights.


<syncfusion:SfRating Height="50" VerticalAlignment="Center" HorizontalAlignment="Center" 
                             VerticalContentAlignment="Center" Value="3">
                    <syncfusion:SfRatingItem Height="20"/>
                    <syncfusion:SfRatingItem Height="18"/>
                    <syncfusion:SfRatingItem Height="16"/>
                    <syncfusion:SfRatingItem Height="14"/>
                    <syncfusion:SfRatingItem Height="12"/>


SfRatingItems with variable size

You can also provide similar height using the ItemContainerStyle property of the SfRating control. The following code implements the ItemContainerStyle property.


<syncfusion:SfRating Height="50" Width="300" ItemsCount="10" Value="4">
                        <Style TargetType="syncfusion:SfRatingItem">
                            <Setter Property="Height" Value="12"/>


SfRatingItems with similar size

You can also provide the height for the SfRatingItem in code behind as follows.


ratingItem.Height = 20;


2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile