This is a migrated thread and some comments may be shown as answers.

How do i change the tooltip value to reflect %

3 Answers 85 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Riad
Top achievements
Rank 1
Riad asked on 25 Aug 2015, 02:40 PM

Hi, 

I currently use the RadRating control to display the % of efficacity of our staff.

 Converting my value to % is easy to reflect this in a 5 stars precision. (i.e: 0.95 * 5  will give me 4.7. ) 

<telerik:RadRating ID="RadRating1" runat="server" Skin="Office2010Black" Orientation="Horizontal" SelectionMode="Continuous" Precision="Exact"
                                         Value='<%# Convert.ToDouble(Eval("PoucentageEfficacite")) * 5 %>' ReadOnly="true">
                                         
                                    </telerik:RadRating>

What I'm trying to acheive is: when I hover the stars, the tooltip would show 95% instead of 4.7

 I'll continue to look in your documentation if i can find something.

 

 

P.S. Is there anyway to set a TotalValue of the RadRating control then when you set the Value, it will auto ajust according to the number of  item displayed. It would be a great addition to the control.

 

 

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 28 Aug 2015, 08:46 AM
Hi Simon,

By default the value property is set as a title to the rating items while the tooltip one is set as title to the rating wrapper.

You can, however, get the rating wrapper title and set it as a title attribute to its items. Take a look at the code below:

JavaScript:
<script>
    function OnClientLoad(sender, args) {
        $ = $telerik.$;
        var parentTitle = $(sender.get_element()).attr('title');
        $(sender.get_element()).find('a').each(function (index) { $(this).attr('title', parentTitle) });
    }
</script>


ASPX:
<telerik:RadRating ID="RadRating1" runat="server" Skin="Office2010Black" Orientation="Horizontal" SelectionMode="Continuous" Precision="Exact"
    Value='4.7' ToolTip="95%" ReadOnly="true" OnClientLoad="OnClientLoad">
</telerik:RadRating>


Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Riad
Top achievements
Rank 1
answered on 14 Sep 2015, 04:21 PM
Thank you.

This answer worked like a charm.

However,why do you use this line? $ = $telerik.$;
The code works without it.

Thank you
0
Danail Vasilev
Telerik team
answered on 15 Sep 2015, 06:32 AM
Hello Simon,

$telerik is the object of the Telerik Client Static Library - http://docs.telerik.com/devtools/aspnet-ajax/controls/telerik-static-client-library. You can access the Telerik's internal jQuery through it.

You can also examine this article (http://docs.telerik.com/devtools/aspnet-ajax/general-information/using-jquery/using-jquery#using-the-jquery-brought-by-telerik) that showcase different ways to utilize the internal jQuery that Telerik UI for ASP.NET AJAX controls provide.

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Rating
Asked by
Riad
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Riad
Top achievements
Rank 1
Share this question
or