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

Align tooltip to left side

2 Answers 111 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
christopher willis
Top achievements
Rank 1
christopher willis asked on 23 Apr 2008, 06:02 PM
Is there a way to align the left side of the tooltip with the left side of the target element?   I'd the tooltip directly under the target element, with the same x starting position, (just like all the dropdowns in the radeditor toolbar )

2 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 24 Apr 2008, 04:30 PM
Hi christopher willis,
In order to position the RadToolTip under the target element, like the popup of a dropdown, you have to set its Position to "BottomCenter", set its OffsetY to "0", and execute the following script in the OnClientShow event of the RadToolTip:
<body>  
 
    <script type="text/javascript">  
    function OnClientShow(sender, args)  
    {  
        var popupBehavior = sender._popupBehavior;  
        popupBehavior.set_x(0);  
        popupBehavior.show();  
    }  
    </script>  
 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" />  
        <div id="myDiv" style="width: 100px; background-color: Red; border: solid 1px black;">  
            Test</div>  
        <telerik:RadToolTip ID="RadToolTip1" runat="server" RelativeTo="Element" TargetControlID="myDiv" 
            Position="BottomCenter" IsClientID="true" ShowCallout="false" Width="200px" Height="300px" 
            OffsetY="0" OnClientShow="OnClientShow">  
        </telerik:RadToolTip>  
    </form>  
</body> 

Sincerely yours,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
christopher willis
Top achievements
Rank 1
answered on 25 Apr 2008, 01:49 AM
Thanks!  That worked. 

However, I had to set the animation to none, or else you could see the tooltip move to the left edge after the initial fade-in.
Tags
ToolTip
Asked by
christopher willis
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
christopher willis
Top achievements
Rank 1
Share this question
or