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 can prevent user interaction with SfRating control?

Platform: UWP |
Control: SfRating |
Product Version:

To prevent the interaction with the SfRating control, set IsReadOnly property to true. When this property is enabled, we could not able to rate the SfRatingItem. But it allows to perform interactions with tooltip and PointerOverFill when precision is changed. In order to prevent this interaction, set ShowTooltip to false and colors for PointerOverFill and PointerOverStroke.

Prevent Mouse interactions with the control by setting IsHitTestVisible property as false.

The same has been explained in the following code example

Code snippet:


<Input:SfRating Value="2" ItemsCount="5" HorizontalAlignment="Center" 
                          VerticalAlignment="Center Precision="Exact" 
                          ShowToolTip="False" IsReadOnly="True">
      <Style TargetType="Input:SfRatingItem">
      <Setter Property="Height" Value="40"/>
      <Setter Property="Width" Value="40"/>
      <Setter Property="RatedFill" Value="Yellow"/>
      <Setter Property="PointerOverFill" Value="Yellow"/>
      <Setter Property="PointerOverStroke" Value="Transparent"/>



            SfRating sfrating = new SfRating()
                Value = 2,
                ItemsCount = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                ShowToolTip = false,
                IsReadOnly = true,
                Foreground = new SolidColorBrush(Colors.Yellow),
                Precision = Syncfusion.UI.Xaml.Primitives.Precision.Exact
            Style style = new Style { TargetType = typeof(SfRatingItem) };
            Setter setter = new Setter();
            setter.Property = SfRatingItem.HeightProperty;
            setter.Value = 40;
            Setter setter1 = new Setter();
            setter1.Property = SfRatingItem.RatedFillProperty;
            setter1.Value = new SolidColorBrush(Colors.Yellow);
            Setter setter2 = new Setter();
            setter2.Property = SfRatingItem.WidthProperty;
            setter2.Value = 40;
            Setter setter3 = new Setter();
            setter3.Property = SfRatingItem.PointerOverFillProperty;
            setter3.Value = new SolidColorBrush(Colors.Yellow);
            Setter setter4 = new Setter();
            setter4.Property = SfRatingItem.PointerOverStrokeProperty;
            setter4.Value = new SolidColorBrush(Colors.Transparent);
            sfrating.ItemContainerStyle = style;




SfRating control interaction in UWP

2X faster development

The ultimate UWP 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