How do i change the tooltip value to reflect %

4 posts, 0 answers
  1. Simon
    Simon avatar
    12 posts
    Member since:
    Nov 2014

    Posted 25 Aug 2015 Link to this post

    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.

     

     

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1493 posts

    Posted 28 Aug 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Simon avatar
    12 posts
    Member since:
    Nov 2014

    Posted 14 Sep 2015 Link to this post

    Thank you.

    This answer worked like a charm.

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

    Thank you
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1493 posts

    Posted 15 Sep 2015 Link to this post

    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
Back to Top