Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ToolTip > Changing TargetControl on the client

Not answered Changing TargetControl on the client

Feed from this thread
  • Posted on Nov 23, 2011 (permalink)

    A rather popular scenario when using the RadToolTip is to use a single instance on the page and utilize the onmouseover event of the  targeted elements to set a new target for the tooltip via JavaScript and show it. Generally the better approach would be to use a RadToolTip for each control or a RadToolTipManager to load content on demand, yet using a single instance reduces the markup on the page, so it is sometimes used.

    When you change a RadToolTip's TargetControl (or TargetControlID) then call its show() method since Q3 2011 you need to do so with a small timeout, e.g.:

    <input type="text" onmouseover="showToolTipNewTarget(this);" />


    <script type="text/javascript">
        function showToolTipNewTarget(newTarget) 
        {
            var radTooltip1 = $find("RadToolTip1");
            radTooltip1.set_targetControl(newTarget);
            setTimeout(function () {
                radTooltip1.show();
            }, 20);
        }
    </script>



    If you do not use this timeout the necessary calculations cannot be performed and usually the tooltip will be shown next to the previous target.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ToolTip > Changing TargetControl on the client
Related resources for "Changing TargetControl on the client"

ASP.NET ToolTip Features   |  Documentation  |  DemosTelerik TV   |  Self-Paced Trainer  |  Step-by-step Tutorial  ]