RadTooltip is not showing when the html code is generated in code behind

2 posts, 0 answers
  1. Kumaran
    Kumaran avatar
    6 posts
    Member since:
    Jan 2014

    Posted 28 Apr Link to this post


    I am using RadTooltip to show some additional info inside a RadGrid cell. The tooltip is showing fine when the page loads. I have a scenario where on some user action, the grid data will change. So I am doing this using a service. The service will load the grid (ascx) in code behind and send back the html code. The html code contains the tool tip with some differences in it. Not sure why it is behaving like this ? The telerik classes not getting applied.

    On Load

    <div style="position: absolute; z-index: 8000; visibility: hidden; left: 227px; top: 542px; display: none;" unselectable="on" class="RadToolTip RadToolTip_Default rtVisibleCallout rosterPopup rtShadow rtRoundedCorner" id="RadToolTipWrapper_ctl00_PlaceHolderMain_ctl00_ctl00_TelerikRosterGridView_ctl00_ctl05_RadToolTipLastName"><div class="rtRelativeWrapper"><span style="visibility: visible;" class="rtCallout rtCalloutTopLeft">&nbsp;</span><div class="rtContent"><div><div><p>Tooltip content</p></div></div></div></div></div>


    Code behind

    <div style="display:none;position:absolute;" id="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName" class="rosterPopup"><div><p>Tooltip content</p></div><input id="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName_ClientState" name="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName_ClientState" type="hidden"></div>




  2. Marin Bratanov
    Marin Bratanov avatar
    3565 posts

    Posted 03 May Link to this post

    Hi Kumaran,

    I am not sure how and where those snippets are used, but here is some info on how RadToolTip works and how to use it, so you can apply this to your scenario:

    • the most common way to tie RadToolTip and RadGrid together is to add targets for the RadToolTipManager and setup its load on demand. Here is a demo that shows this scenario: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=tooltip.
    • RadToolTipManager can automatically take the title attribute of an HTML node and create a RadToolTip from it, instead of the browser providing the tooltip. What's important here is that this works only on the initial page load or after the content was updated with AJAX (a partial postback). If you "manually" change the HTML via JavaScript, the tooltip manager cannot be notified of this change and the old target and content it had created will not be detached from the actual DOM, because the elements that were used have been disposed. In such cases you should use the tooltipify(parentNode) method the tooltip manager offers where you should pass a suitable parent node whose children were changed: http://docs.telerik.com/devtools/aspnet-ajax/controls/tooltip/client-side-programming/radtooltipmanager-object. That's basically what RadToolTIpManager does internally for AJAX requests.
    • RadToolTips are MS AJAX-based WebForms server controls. This means they require postbacks to be created and to work, as they rely on the WebForms page lifecycle on the server and the MS AJAX lifecycle on the client. Just putting their HTML on the page is not enough to initialize them and for them to work. Thus, they cannot be returned as plain HTML from a WebService, for example, as is the case with all IScriptControls such as ours. 

    I hope this helps you understand how the control works and how you can employ it in your case.


    Marin Bratanov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top