ToolTip CloseButton position

4 posts, 1 answers
  1. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 28 Jun 2010 Link to this post

    Hi,

    I have implemented a RAD tooltip manager to a label inside a grid with the HideEvent="ManualClose". The original width of tooltip is 30px (Width="30px") and is reset dynamically to fit actual information inside. However, the close button is still on it's original position. Is there any way to set up the Close button to be always on the top left corner of the tooltip?

    Thank you
  2. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2010 Link to this post

    Today I tried different approach and still have a problem with the Close button. I changed the HideEvent from "Default" to "ManualClose " on OnClientBeforeShow event:

     

            function OnClientBeforeShow(sender, args) {

     

     

                var current = Telerik.Web.UI.RadToolTip.getCurrent();

     

     

                if (current) {

     

                    current.set_hideEvent(Telerik.Web.UI.ToolTipHideEvent.ManualClose);

     

                }

     

            }

    After that, the tooltip stayed open but there were no Close button at all. Do I need to do something special in order the Close button to be visible?

    Thanks again
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 01 Jul 2010 Link to this post

    Hi DW,

    The RadToolTip provides a method whcih returns the manual close button and you can use it to modify its position. I prepared for you the following sample code:


    <script type="text/javascript">
        function OnClientShow(sender, args)
        {
            var btn = sender.getManualCloseButton();
            btn.style.left = "0px";
        }
    </script>
    <asp:HyperLink ID="target" runat="server" Text="Target control"></asp:HyperLink>
    <telerik:RadToolTip ID="tip" runat="server" RelativeTo="Element" TargetControlID="target"
        Width="200px" Height="200px" HideEvent="ManualClose" OnClientShow="OnClientShow">
        The product was successfully added to the cart!
    </telerik:RadToolTip>


    Please, test my solution and let me know how it goes.

    Sincerely yours,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 01 Jul 2010 Link to this post

    Hello Svetlina,

    The solution works!
    Thank you very much!
Back to Top