Manual Closing For Tooltips

10 posts, 2 answers
  1. Chamira
    Chamira avatar
    78 posts
    Member since:
    Nov 2007

    Posted 23 Jul 2009 Link to this post

    whats the coding thats required to close the opened tooltip from an asp.net button.
    using the RadToolTipManager

    for example.. to give a similar action as ManualClose (X) on the radToolTipManager property.

    Thanks
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jul 2009 Link to this post

    Hello Chamira,

    Check out the following example which can be used to hide a tooltip on a button click:
    aspx:
     <telerik:RadToolTipManager ID="RadToolTipManager1" Text="Custom RadToolTip Text"  
             HideEvent="FromCode"  runat="server">       
             <TargetControls> 
             <telerik:ToolTipTargetControl TargetControlID="TargetControl" />          
             </TargetControls>   
            </telerik:RadToolTipManager> 
             
            <asp:Button ID="Button1" runat="server" Text="Hide Tooltip" OnClientClick="return CloseToolTip()" /> 

    js:
    function CloseToolTip()      
        {          
            var controller = Telerik.Web.UI.RadToolTipController.getInstance();   
            var tooltip = controller.get_activeToolTip();     
            if(tooltip) 
             tooltip.hide();   
              
             return false
        }  

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

    Posted 24 Jul 2009 Link to this post

    Hi guys,

    Basically, the syntax you use is correct but getting the reference to the active tooltip in this manner is now obsolete. The new syntax do not need to get teh controller but to simplyt use the static getCurrent method as shown below:

    function CloseToolTip()         
        {             
        
            var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();    
            if(tooltip)   
            {   
              tooltip.hide();     
            }   
        }     
     



    Regards,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. James MacFarlane
    James MacFarlane avatar
    2 posts
    Member since:
    Jul 2009

    Posted 24 Jul 2009 Link to this post

    I am having problems getting ManualClose to work. I see the DIV in the right place, but no action is performed when clicking on it. No changes to the code have been made as it was working with the pre Q1 2009 version. Does something need to be added for the Q1 2009 version here?

    <telerik:radtooltip ID="RadToolTip1" runat="server" Skin="Web20"
                TargetControlID="AnnualReportsTip" Position="TopCenter" ShowEvent="OnClick"
                HideEvent=ManualClose>
                <uc1:AnnualReports ID="AnnualReports1" runat="server" />
            </telerik:radtooltip>
           <asp:HyperLink CssClass="newsLink" ID="AnnualReportsTip" NavigateUrl="/text.aspx" Target="_blank" runat="server">Click here to view selected highlights</asp:HyperLink>
  6. Chamira
    Chamira avatar
    78 posts
    Member since:
    Nov 2007

    Posted 27 Jul 2009 Link to this post

    thanks both of you.. both marked as answers..
    once again thanks
  7. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 27 Jul 2009 Link to this post

    Hello guys,

    Chamira, I am glad I could help in your implementation.

    James, I built up a test demo page based on your code but unfortumately I was not able to reproduce the issue - the tooltip hides as expected when I click on the manual close button. I tested the page with both Q1 and Q2 2009 and under IE8 as noted but everything worked as expected.

    I attached my tets page to teh thread for your reference, please examine it and let me know if I am missing something and what should I do to reproduce the problem. Once I have a better understanding on the issue I will do my best to help.

    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. James MacFarlane
    James MacFarlane avatar
    2 posts
    Member since:
    Jul 2009

    Posted 30 Jul 2009 Link to this post

    Here is the page that demonsrates the problem. Click on "Click here to view selected highlights" just under the main image. The Tooltip close button does not work.

    http://beta.moveableonline.com/

    Thank you.

    - James.


  9. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 04 Aug 2009 Link to this post

    Hello James,

    I examined the provided live url and I was able to reproduce the problem. However, I am afraid that examining the issue online is not enough to find the exact reason for the issue. That is why I would like to kindly ask you to modify the test page I last sent you in order to reproduce the problem and share all the needed source here so that I will be able to directly create a reproduction demo and analyze it on my side. While you are isolating the issue in my test demo, I suggest to disable ajax in your original application and in case this fixes the issue, just replicate the same ajax settings to the test page.

    Once I am able to reproduce and investigate the problem locally I will do my best to help.

    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Peter
    Peter avatar
    1 posts
    Member since:
    Jul 2012

    Posted 20 Jan 2010 Link to this post

    That was a pretty lame answer.
  11. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Jan 2010 Link to this post

    Hi Peter,

    I am sorry to see that you didn't like the answer that Svetlina provided, but please note that it was the best that we could give at this time. The code that James sent was working as expected and should not cause a problem as the one that he reported. The beta site in question was quite complex and just by checking the behavior and examining the HTML dump we were not able to pinpoint the reason for the problem.
    That is why Svetlina asked for additional details and attached a small sample to this thread which James could check and tell what are the differences between it and his exact setup and logic. We, however haven't received reply from him.

    If you experience the same problem, please provide more information about the exact setup and if possible, please rework Svetlina's sample page so it reproduces the problem and send it back to us - we will check it right away and do our best to help.


    All the best,
    Georgi Tunev
    Senior Support
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017