Tooltip title when using Tooltipmanager in Grid

3 posts, 1 answers
  1. Albert Shenker
    Albert Shenker avatar
    580 posts
    Member since:
    Mar 2004

    Posted 18 Sep 2014 Link to this post

    I have a tooltip manager on a page and I tooltipify rad grid rows using the standard method outlined in the demos. I would like to specify the tooltip title based on the row. How do I do that? It doesn't look like there is any server-side access to the specific tooltip being generated in the OnAjaxUpdate event handler. I also thought maybe I could handle the OnClientBeforeShow, or OnClientShow events of the TooltipManager client-side and set the title that way, but I couldn't figure out how to either get an instance of the tooltip being generated, or pass info from the Grid ItemDatabound event to the tooltip so I can use the set_title() method.
  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    5242 posts

    Posted 19 Sep 2014 Link to this post

    Hello Albert,

    The OnClientShow event receives the tooltip instance as its first argument: This example shows a RadToolTip, but the same applies for a RadToolTipManager.

    There is also a common class that lets you get the currently active tooltip:

    So, you can use this reference and set the title via JavaScript, for example: (see the set_title() method).

    You can base that decision on several factors, for example:

    • the get_value() method will provide the Value contents. If this does not suffice, you can concatenate the desired title on the server, e.g. "desiredValue|desiredTitle" and split() the string according to the used symbol.
    • the get_targetControl() method will return the DOM object of the tooltip target. You can use it to extract text or a custom attribute from it so you can set the title accordingly

    Yet another option is to register a script that will execute after the AJAX request returns ( that will set the desired title on the currently active tooltip (see the beginning of the post).


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Albert Shenker
    Albert Shenker avatar
    580 posts
    Member since:
    Mar 2004

    Posted 19 Sep 2014 in reply to Marin Bratanov Link to this post

    Thanks. I used the method of obtaining the tooltip targetControl client-side. In the grid ItemDatabound event handler, I set an attribute on the target control, and then read this client side. It works well. It would be great if the Telerik TargetControlCollection, and Add method provided a way to supply additional attributes, aside from just a single value, and then have these available client-side. This would be powerful and would make it unnecessary to rely on target control dom variations.
Back to Top