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

Access RadToolTip on page load

1 Answer 103 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 13 Jul 2011, 08:51 PM
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?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 14 Jul 2011, 04:00 PM
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:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/autotooltipify/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipzoneid/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx


All the best,
Marin
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!

Tags
ToolTip
Asked by
Patrick
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or