)
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. (Last updated on: June 24, 2019).
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 |
Published Date: January 23, 2015 |
Last Revised Date: June 21, 2019

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

XAML

<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"/>
                </syncfusion:SfRating>

 

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.

XAML

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

 

SfRatingItems with similar size

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

C#

ratingItem.Height = 20;

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
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
Live Chat Icon