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

Handle Tooltip Close event server-side

1 Answer 133 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 24 Jun 2008, 04:59 PM
Is it possible to handle the tooltip close event server-side? Here is my scenario. I use the tootip to display a form. The form contains several pageviews depending on choices the user makes. Swithcing between pageviews is done with Ajax. If the tooltip closes, I wish to select the default pageview so that the next time the tootip is show, the initial pageview is selected (as opposed to whatever pageview they were on when they closed the tooltip).

1 Answer, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 24 Jun 2008, 09:36 PM
Hi Albert,

You can achieve this functionality by using a RadAjaxManager or RadAjaxPanel and initiating an ajaxRequest from the client during the ClientHide event of the RadToolTip. Here is an example:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
                 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
                function RadToolTip1_ClientHide(sender, eventArgs) 
                { 
                    var ajaxPanel = $find('<%= RadAjaxPanel1.ClientID %>'); 
                    ajaxPanel.ajaxRequest(); 
                } 
            </script> 
        </telerik:RadCodeBlock>      
         
        <asp:Image ID="Image1" runat="server" 
            ImageUrl="http://tinyurl.com/5ah67f" /> 
             
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  
            OnAjaxRequest="RadAjaxPanel1_AjaxRequest"
            <telerik:RadToolTip ID="RadToolTip1" runat="server" 
                TargetControlID="Image1"             
                Skin="Sunset" 
                RelativeTo="Element" 
                Sticky="true" 
                OnClientHide="RadToolTip1_ClientHide"
                Enter some text:  
                <telerik:RadTextBox ID="RadTextBox1" runat="server" /> 
            </telerik:RadToolTip> 
             
            <asp:Literal ID="Literal1" runat="server" /> 
        </telerik:RadAjaxPanel> 
         
    </form> 
</body> 
</html> 
 

public partial class _Default : System.Web.UI.Page 
    public void RadAjaxPanel1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) 
    { 
        string text = RadTextBox1.Text; 
        Literal1.Text = string.Format("You entered: {0}.", text); 
    } 
 


If you have any further questions, please feel free to ask. I hope this has helped.

Regards,
Kevin Babcock
Tags
ToolTip
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Kevin Babcock
Top achievements
Rank 1
Share this question
or