New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Client-side Programming Overview

Getting the RadRating client-side object:

RadRating creates a client-side object with the ClientID of the menu. You can obtain the reference using the following JavaScript code:

JavaScript
var rating = $find("<%= RadRating1.ClientID %>");

Once you have a reference to the control, you could use the following methods:

Methods of the RadRating client-side object.

NameParametersReturn TypeDescription
repaintRepaints the rating control and forces it to recalculate the size of its elements. Use this method when the control is in an initially hidden element
get_itemCountNumberNumberGets the number of items (stars) in the rating control
get_valueNumberGets the current value of the rating control
set_valueNumberSets the current value of the rating control
get_selectionModeTelerik.Web.UI.RatingSelectionModeGets the selection mode of the rating control
set_selectionModeTelerik.Web.UI.RatingSelectionModeSets the selection mode of the rating control
get_precisionTelerik.Web.UI.RatingPrecisionGets the rate precision of the rating control
set_precisionTelerik.Web.UI.RatingPrecisionSets the rate precision of the rating control
get_orientationTelerik.Web.UI.OrientationGets the orientation of the rating control
get_isDirectionReversedBooleanReturns a value, indicating whether the direction of the rating control is revered
get_enableToolTipsBooleanReturns a value, indicating whether the rating control will display a browser toolip for its values
get_readOnlyBooleanReturns a value, indicating whether the rating control is in read-only mode
set_readOnlyBooleanSets a value, indicating whether the rating control is in read-only mode
get_enabledBooleanReturns a value, indicating whether the rating control is enabled
set_enabledBooleanSets whether the slider is enabled
get_itemDataArrayGets information about the items of the rating

Methods of the RadRating client-side object for modifying client-side event handlers dynamically.

NameParametersReturn TypeDescription
add_loadFunctionAdds a handler for the load event
remove_loadFunctionRemoves a handler for the load event
add_ratingFunctionAdds a handler for the rating event
remove_ratingFunctionRemoves a handler for the rating event
add_ratedFunctionAdds a handler for the rated event
remove_ratedFunctionRemoves a handler for the rated event