radtooltip does not work after ajax refresh

2 posts, 0 answers
  1. Mohammad Armin
    Mohammad Armin avatar
    1 posts
    Member since:
    Apr 2010

    Posted 14 Jul 2011 Link to this post

    Hi Everyone

    I'm new to this site and this is my first post. So please forgive me if this issue had alrady been posted.

    I have a radtooltip inside a simple webpart (not a visual webpart) in a Sharepoint project. Because the webpart is not a visual one, I create a tooltip together with all the other components on the server side in the OnPreRender event.

    There is a radajaxpanel surounding the webpart which in turn contains a div which in turn contains a table for every record I want to display in the webpart. Each table contains a radtooltip. There is also a radajaxloadingpanel that points to my webpart.

    My webpart is connected to a calendar webpart on the page. When the user interacts with the calendar webpart and selectes a different date, I refresh my webpart  to display the data for that day. The problem is the radtooltip in my webpart stops working after the webpart is refreshed via ajax.

    Also, when the page first loads or does a full refresh, sometimes the radtooltip works and sometimes it does not.

    The bit of the code that creates the tooltip in the webpart is as follows:

    RadToolTip tooltip = new RadToolTip();
    tooltip.ID = "RadToolTip" + note.ID;
    tooltip.TargetControlID = "divSubject" + note.ID;
    tooltip.IsClientID = true;
    tooltip.ShowEvent = ToolTipShowEvent.OnMouseOver;
    tooltip.HideEvent = ToolTipHideEvent.LeaveToolTip;
    tooltip.RelativeTo = ToolTipRelativeDisplay.Element;
    tooltip.Skin = "Hay";
    tooltip.Animation = ToolTipAnimation.None;
    tooltip.ShowCallout = true;
    tooltip.Title = note.Subject;
    tooltip.CssClass = "diaryToolTip";
    tooltip.EnableAjaxSkinRendering = true;
    tooltip.RegisterWithScriptManager = true;
    string line = @"<table border='0'>
    <td valign='top' align='left' width='60'>
    <strong>Type: </strong>
    <td align='left'>" + note.TypeName +

    tooltip.Controls.Add(new LiteralControl(line));



    ("note" is a custom class and "phDiary" is the placeholder object that holds all components)

    Any help is greatly appreciated.




  2. Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 19 Jul 2011 Link to this post

    Hi Mohammad,

    Such non-consistent behavior would usually mean that the target control is not set properly, most often caused by a typing error in the provided ID. Please make sure that this property is always correct and that you are using the ClientID if the target is a server control, as an INaming container would change this ID and the tooltip wouldn't show. I prepared a simple test page that tries to emulate your behavior, yet it works fine on my end. Please compare your setup with it and try to locate any major differences in the logic.

    Another possible cause would be a JavaScript error on the page, which would result in the RadToolTip's scripts not executing. Please also check your project for this as well.

    Kind regards,
    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!

Back to Top