Close the tooltip with a button

3 posts, 1 answers
  1. Kishan Gandikota
    Kishan Gandikota avatar
    44 posts
    Member since:
    Sep 2009

    Posted 24 Sep 2009 Link to this post

    Hi Telerik team,

    I am working on rad tooltip manager and I am facing some issues.

    I have created a RAD tooltip manager in aspx.

    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Width="250" Height="300"
                        OffsetY="-7" OffsetX="10" RelativeTo="Element" Position="BottomCenter" HideEvent="ManualClose"
                        OnAjaxUpdate="OnAjaxUpdate" ShowEvent="OnClick">
                    </telerik:RadToolTipManager>

    Then I created an user control .ascx which will be my tooltip. My tooltip code looks something like this.

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Tooltip.ascx.cs" Inherits="RADPrototype.Tooltip" %>
    <asp:Label ID="lblMarketValue" runat="server" Text="Market Value"></asp:Label>
    <asp:Button ID="Close" runat="server" Text="Button" />

    Please observe that I have close button on the tooltip. In aspx.cs file, I am adding this tooltip to the tooltip manager.

    this.RadToolTipManager1.TargetControls.Add(target.ClientID, "123$", true);

    My problem is when I click on Close button on the popup (in ascx), popup is not closing. (However when I click on x button, tooltip getting closed). Since I am using HideEvent as manual close, I am getting x button to the tooltip. However having the close button and selecting it, is not closing it. I wrote onclientclick for the button to close it. But it is not happening. Could you please provide me your help on this?

    Thanks.

    Regards,
    Kishan G K
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Sep 2009 Link to this post

    Kishan G K,

    I tried the following code and it worked as expected. Check with your code for differences and let me know if it helps:
    ascx:
    <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="hide();" /> 

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

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kishan Gandikota
    Kishan Gandikota avatar
    44 posts
    Member since:
    Sep 2009

    Posted 06 Oct 2009 Link to this post

    Hi,

    I have added additionality page.registerstartupscript in my ascx.cs. Now the problem is fixed. Thanks.
Back to Top