Going back to 2009, there is a forum discussion of this issue at http://www.telerik.com/forums/two-way-rating-precision. The response at the time indicated that a change was coming, but I have since learned that this change never happened. If I set Value="2.5" and Precision="Item", the Value is rounded to 3. It should be possible to allow users to rate only a whole number of stars (Precision="Item"), but if the Value is set to a decimal, it should display the fractional result.
The hovered state of the items of RadRating is not cleared when the Precision property of the rating is set to Item. A possible workaround is adding the following script just before the closing </form> tag: var $T = Telerik.Web.UI; $T.RadRating.prototype._mouseOut = function (e, mouseMove) { var targetElement = e.target || e.srcElement; if (this._ulWrapper === targetElement || $telerik.$(this._ulWrapper).has(targetElement).length > 0) { if (!mouseMove && $T.RatingPrecision.Item != this._precision) this._hoveredItem = null; } this._attachDocumentHandlers(false); this._createPartElements(false); this._storeStartCoords(false); this._spanSize = null; this._hoveredItem = null; this._clearOverState(); if (this._clearSelectedStateOnHover) this._synchronizeUIWithValue(this._value); }
Here you are a possible workaround by overriding the RadRating's _mouseOut method: <telerik:RadRating ID="RR1" runat="server" RenderMode="Lightweight" Precision="Item"> <Items> <telerik:RadRatingItem Value="0" /> <telerik:RadRatingItem Value="1" /> <telerik:RadRatingItem Value="2" /> <telerik:RadRatingItem Value="3" /> <telerik:RadRatingItem Value="4" /> </Items> </telerik:RadRating> <script> Telerik.Web.UI.RadRating.prototype._mouseOut = function (e, mouseMove) { var isMouseOverUl = $telerik.isMouseOverElementEx(this._ulWrapper, e); if (isMouseOverUl) { // Clear the reference here as the mouseOver event is raised after the mouseMove with reference to the old hovered item. Thus the code for // mouseMove is executed for the old hovered item with mouse coordinates relative to the new hovered item leading to blinking effect. if (!mouseMove && $T.RatingPrecision.Item != this._precision) this._hoveredItem = null; $telerik.cancelRawEvent(e); } this._attachDocumentHandlers(false); this._createPartElements(false); this._storeStartCoords(false); this._spanSize = null; this._hoveredItem = null; this._clearOverState(); if (this._clearSelectedStateOnHover) this._synchronizeUIWithValue(this._value); }; </script>
RadRating has anchor elements in its default rendering and they can still be focused via the Tab key even if the control is disabled. Since the disabled attribute is not valid for anchor tags, they can have tabIndex set to -1 to prevent keyboard focus. Here is a small sample that shows how you can achieve this: <asp:TextBox ID="Textbox1" runat="server" /> <telerik:RadRating runat="server" ID="RadRating1" Enabled="false" OnClientLoad="OnClientLoad"> </telerik:RadRating> <script> function OnClientLoad(sender, args) { if (!sender.get_enabled()) { var anchors = sender.get_element().getElementsByTagName("a"); for (var i = 0; i < anchors.length; i++) { anchors[i].setAttribute("tabIndex", "-1"); } } } </script>
Numbers start appearing in the items of RadRating when RenderMode is Lightweight and text-align:right is applied to a parent element of the control.
Currently the RadRating control can be used in touch devices only when its Precision property is set to Item. It should be possible to perform selection in the rating regardless of its precision.
The hovered state of the items of RadRating is not cleared when the Precision property of the rating is set to Item. A possible workaround is adding the following script just before the closing </form> tag: var $T = Telerik.Web.UI; $T.RadRating.prototype._mouseOut = function (e, mouseMove) { var targetElement = e.target || e.srcElement; if (this._ulWrapper === targetElement || $telerik.$(this._ulWrapper).has(targetElement).length > 0) { if (!mouseMove && $T.RatingPrecision.Item != this._precision) this._hoveredItem = null; } this._attachDocumentHandlers(false); this._createPartElements(false); this._storeStartCoords(false); this._spanSize = null; this._hoveredItem = null; this._clearOverState(); if (this._clearSelectedStateOnHover) this._synchronizeUIWithValue(this._value); }
It will be possible to configure custom attributes for the items of the RadRating control, similarly to the Custom Attributes implementation for RadComboBox: http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/customattributes/defaultcs.aspx