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

Close the tooltip with a button

2 Answers 247 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Kishan Gandikota
Top achievements
Rank 1
Kishan Gandikota asked on 24 Sep 2009, 06:46 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 25 Sep 2009, 06:54 AM
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.
0
Kishan Gandikota
Top achievements
Rank 1
answered on 06 Oct 2009, 02:24 PM
Hi,

I have added additionality page.registerstartupscript in my ascx.cs. Now the problem is fixed. Thanks.
Tags
ToolTip
Asked by
Kishan Gandikota
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kishan Gandikota
Top achievements
Rank 1
Share this question
or