Access RadToolTip on page load

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    6 posts
    Member since:
    Jun 2011

    Posted 13 Jul 2011 Link to this post

    I have a page that has RadToolTips on it.  They are never named the same and their number varies.  I can't seem to find a way to access them from javascript on page load because they seem to be hidden.  I need a collection of all the RadToolTips when the page is ready so I can determine their targetcontrolid's and bind onclick events to the target controls so that when a user clicks or hovers the target control, the tooltip is shown.  Any ideas?
  2. Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 14 Jul 2011 Link to this post

    Hi Patrick,

      Please note that if you have set the targetControlID property of each tooltip and their ShowEvent is different than FromCode they will automatically attach the needed events to their target elements.

      if that is not the case I would suggest adding the desired controls in the targetControlID property of the tooltip when you create it (I assume you do so from the code-behind). You could also use the RadToolTIpManager and add all the desired targets to its targetControls collection. You could also use the autotooltipify functionality of the manager, depending on the scenario.

    As for accessing them this is possible at earliest in the pageLoad() JavaScript event or the Sys.Application.Load event. If you want to use them by dynamically assigning events I would suggest giving your tooltips predictable IDs, for example RadToolTip1, RadToolTip2, RadToolTip3, etc so you can use a simple while loop and $find() them all.

    Please examine the following list of online demos to see some useful ideas on using tooltips:

    All the best,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft R3 2016 release webinar banner
Back to Top