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

Problem with tooltip positioning

2 Answers 85 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 01 Oct 2009, 05:40 PM
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 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 06 Oct 2009, 02:15 PM
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.
0
Michael
Top achievements
Rank 1
answered on 12 Oct 2009, 06:16 PM
I am on version - 2008.02.0826.35.  This OnClientResponseEnd is not available but adjusting the height worked...thanks
Tags
ToolTip
Asked by
Michael
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Michael
Top achievements
Rank 1
Share this question
or