Class RatingBuilder
Inheritance
System.Object
RatingBuilder
Assembly: Syncfusion.EJ2.dll
public class RatingBuilder : ControlBuilder
Constructors
Declaration
Declaration
public RatingBuilder(Rating model)
Parameters
Type |
Name |
Description |
Rating |
model |
|
Fields
Declaration
Field Value
Properties
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
Defines whether to show or hide the reset button in a rating component.
When set to "true", the reset button will be visible to the user, and they will be able to click it to reset the rating value to its default value.
Declaration
public RatingBuilder AllowReset(bool allowReset = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowReset |
|
Returns
Event callback that is raised before rendering each item.
Declaration
public RatingBuilder BeforeItemRender(string beforeItemRender)
Parameters
Type |
Name |
Description |
System.String |
beforeItemRender |
|
Returns
Event callback that is raised after rendering the rating.
Declaration
public RatingBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
Defines one or more CSS classes that can be used to customize the appearance of a rating component.
One or more CSS classes to customize the appearance of the rating component, such as by changing its colors, fonts, sizes, or other visual aspects.
Declaration
public RatingBuilder CssClass(string cssClass)
Parameters
Type |
Name |
Description |
System.String |
cssClass |
|
Returns
Defines whether a rating component is enabled or disabled.
A disabled rating component may have a different visual appearance than an enabled one.
When set to "true", the rating component will be disabled, and the user will not be able to interact with it.
Declaration
public RatingBuilder Disabled(bool disabled = true)
Parameters
Type |
Name |
Description |
System.Boolean |
disabled |
|
Returns
Defines the template that defines the appearance of each un-rated item in a rating component.
Declaration
public RatingBuilder EmptyTemplate(string emptyTemplate)
Parameters
Type |
Name |
Description |
System.String |
emptyTemplate |
|
Returns
Defines whether to add animation (to provide visual feedback to the user) when an item in a rating component is hovered.
When set to "true", an animation will be added when the user hovers their cursor over an item in the rating component.
Declaration
public RatingBuilder EnableAnimation(bool enableAnimation = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableAnimation |
|
Returns
Enable or disable persisting component's state between page reloads.
Declaration
public RatingBuilder EnablePersistence(bool enablePersistence = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enablePersistence |
|
Returns
Enable or disable rendering component in right to left direction.
Declaration
public RatingBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
Defines whether to select all the items before the selected item should be in selected state in a rating component.
When set to "true", only the selected item will be in the selected state, and all other items will be un-selected.
When set to "false", all items before the selected one will be in the selected state.
Declaration
public RatingBuilder EnableSingleSelection(bool enableSingleSelection = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableSingleSelection |
|
Returns
Defines the template that defines the appearance of each rated item in a rating component.
Declaration
public RatingBuilder FullTemplate(string fullTemplate)
Parameters
Type |
Name |
Description |
System.String |
fullTemplate |
|
Returns
Allows additional HTML attributes such as title, name, etc., and
accepts n number of attributes in a key-value pair format.
Declaration
public RatingBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
Defines the specific number of items (symbols) in rating component.
The rating component typically consists of a number of items, such as stars or other symbols, that represent the rating value.
Declaration
public RatingBuilder ItemsCount(int itemsCount)
Parameters
Type |
Name |
Description |
System.Int32 |
itemsCount |
|
Returns
Defines the position of the label in rating component.
Declaration
public RatingBuilder LabelPosition(LabelPosition labelPosition)
Parameters
Returns
Defines the template that used as label over default label of the rating. The current value of rating passed as context to build the content.
Declaration
public RatingBuilder LabelTemplate(string labelTemplate)
Parameters
Type |
Name |
Description |
System.String |
labelTemplate |
|
Returns
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public RatingBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
Defines the value that specifies minimum rating that a user can select.
The value is set to 0, which means that the minimum possible rating is 0.
Declaration
public RatingBuilder Min(double min)
Parameters
Type |
Name |
Description |
System.Double |
min |
|
Returns
Event callback that is raised when a user hovers over an item.
Declaration
public RatingBuilder OnItemHover(string onItemHover)
Parameters
Type |
Name |
Description |
System.String |
onItemHover |
|
Returns
Defines the precision type of the rating which used to component the granularity of the rating,
allowing users to provide ratings with varying levels of precision.
Declaration
public RatingBuilder Precision(PrecisionType precision)
Parameters
Returns
Defines a boolean value that specifies whether the read-only mode is enabled for a rating component,
which prevents the user from modifying or interacting with the rating value but allows them to read it.
Declaration
public RatingBuilder ReadOnly(bool readOnly = true)
Parameters
Type |
Name |
Description |
System.Boolean |
readOnly |
|
Returns
Declaration
public HtmlString Render()
Returns
Type |
Description |
Microsoft.AspNetCore.Html.HtmlString |
|
Defines a value that specifies whether to display a label that shows the current value of a rating.
When set to "true", a label will be displayed that shows the current value of the rating; otherwise false.
Declaration
public RatingBuilder ShowLabel(bool showLabel = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showLabel |
|
Returns
Defines a value that defines whether to show tooltip for the items.
When set to "true", show tooltip for the items.
Declaration
public RatingBuilder ShowTooltip(bool showTooltip = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showTooltip |
|
Returns
Defines the template that used as tooltip content over default tooltip content of the rating.
The current value of rating passed as context to build the content.
Declaration
public RatingBuilder TooltipTemplate(string tooltipTemplate)
Parameters
Type |
Name |
Description |
System.String |
tooltipTemplate |
|
Returns
Defines the current rating value which used to display and update the rating selected by the user.
Based on "PrecisionType", users can select ratings with varying levels of precision.
The "value" is a decimal value that ranges from the minimum value to the items count,
as specified by the "min" and "itemsCount" properties of the rating.
Declaration
public RatingBuilder Value(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Event callback that is raised when the value is changed.
Declaration
public RatingBuilder ValueChanged(string valueChanged)
Parameters
Type |
Name |
Description |
System.String |
valueChanged |
|
Returns
Defines a value that indicates whether the rating component is visible or hidden.
When set to "true", if the rating component is visible.
Declaration
public RatingBuilder Visible(bool visible = true)
Parameters
Type |
Name |
Description |
System.Boolean |
visible |
|
Returns