Align tooltip to left side

3 posts, 0 answers
  1. christopher willis
    christopher willis avatar
    47 posts
    Member since:
    Sep 2006

    Posted 23 Apr 2008 Link to this post

    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. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 24 Apr 2008 Link to this post

    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
  3. christopher willis
    christopher willis avatar
    47 posts
    Member since:
    Sep 2006

    Posted 24 Apr 2008 Link to this post

    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.
Back to Top