Problem with tooltip positioning

3 posts, 0 answers
  1. Michael
    Michael avatar
    8 posts
    Member since:
    Sep 2007

    Posted 01 Oct 2009 Link to this post

    Hello,

    I have a problem with the tooltip positioning with some elements on my page.  I am using the TooltipManager and execute a method on the OnAjaxUpdate event.  This method will dynamically set the text of the tooltip based on the item and the client's access.  The text will either be one sentence long or one paragraph long.  If it is one sentence long it works fine, if it is one paragraph it does not position correctly.  I have Animation set to 'none'.  Before it was set to 'fade', this worked but it was slow and initially it was positioned wrong but after a second was positioned correctly.   How do I get this to position correctly with Animation set to 'none'.  Here is my sample code: 

    <telerik:RadToolTipManager  ID="rttmTooltip"
                                runat="server"
                                Height="50px"
                                Width="300px"
                                ShowEvent="onMouseOver"  
                                HideEvent="LeaveToolTip"
                                Animation="None"
                                Position="MiddleRight"
                                RelativeTo="Element"
                                OffsetY="-3"  
                                OnAjaxUpdate="rttmTooltip_AjaxUpdate"
                                Skin="Vista"
                                AutoCloseDelay="200000" >
            <TargetControls>
                <telerik:ToolTipTargetControl IsClientID="false"  TargetControlID="dApples" value="Apples"/>
                <telerik:ToolTipTargetControl IsClientID="false"  TargetControlID="dBananas" value="Bananas"/>
                <telerik:ToolTipTargetControl IsClientID="false"  TargetControlID="dPears" value="Pears"/>
                <telerik:ToolTipTargetControl IsClientID="false"  TargetControlID="dOranges" value="Oranges"/>
            </TargetControls>
            </telerik:RadToolTipManager>

    Thanks,

    Michael
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 06 Oct 2009 Link to this post

    Hi Michael,
    I suppose the position of the RadToolTip is sometimes not correct, in case its Height is not 50 pixels as you have specified. In case you want the tooltip to always respect this setting, you should set the ContentScrolling property of the RadToolTipManager as well.

    In case you do not want your RadToolTips to display scrollbars and you cannot set the correct Height for them (that is Height that will always be respected), you can use the following approach:
    <telerik:RadToolTipManager ID="rttmTooltip" runat="server" saHeight="50px" Width="300px" 
        ShowEvent="onMouseOver" HideEvent="LeaveToolTip" Animation="None" Position="MiddleRight" 
        RelativeTo="Element" OffsetY="-3" OnAjaxUpdate="rttmTooltip_AjaxUpdate" Skin="Vista" 
        AutoCloseDelay="200000" OnClientResponseEnd="OnClientResponseEnd"

    <script type="text/javascript"
    function OnClientResponseEnd(sender, args) 
        var activeToolTip = Telerik.Web.UI.RadToolTip.getCurrent(); 
        activeToolTip.updateLocation(); 
        activeToolTip._adjustCallout(); 
    </script> 

    Basically, the problem with the position is a result of the following:
    1. The height of the RadToolTip depends on the content of the tooltip.
    2. The content of the RadToolTip is not loaded when the tooltip shows.
    3. The position of the tooltip depends of the height of the tooltip.

    Greetings,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael
    Michael avatar
    8 posts
    Member since:
    Sep 2007

    Posted 12 Oct 2009 Link to this post

    I am on version - 2008.02.0826.35.  This OnClientResponseEnd is not available but adjusting the height worked...thanks
Back to Top