Selection in ASP.NET Core Rating Control

23 Jan 20231 minute to read

The ASP.NET Core Rating control allows users to rate something using a visual scale, and the selection state can be changed by the user clicking or tapping on the stars in the rating scale or through code. The Rating control has a minimum value and a reset button, and provides customization options for the selected rating value and selection behavior.

@using Syncfusion.EJ2.Inputs

<ejs-rating id="rating" value=3></ejs-rating>

ASP.NET Core Rating Control with Selction

Min value

You can use the min property of the ASP.NET Core Rating control to set the minimum possible rating value the user can select. If you set the min property to 2, then you will not be able to select a rating lower than 2.

@using Syncfusion.EJ2.Inputs

<ejs-rating id="rating" min=2></ejs-rating>

ASP.NET Core Rating Control with Minimum Value

Single selection

You can use the enableSingleSelection property of the ASP.NET Core Rating control to select only one item at a time. When the enableSingleSelection property is set to true, only the selected item will be considered to be in the selected state, while all other items will be unselected.

@using Syncfusion.EJ2.Inputs

<ejs-rating id="rating" value=3 enableSingleSelection=true></ejs-rating>

ASP.NET Core Rating Control with Single Selection

Show or hide reset button

You can reset the rating value to its default by using the allowReset property of the ASP.NET Core Rating control. When the allowReset property is set to true, a reset button will be shown that allows the user to reset the rating value to its default.

@using Syncfusion.EJ2.Inputs

<ejs-rating id="rating" value=3 allowReset=true></ejs-rating>

ASP.NET Core Rating Control with Reset button