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

Refreshing Tooltip Dynamically

3 Answers 103 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
blara
Top achievements
Rank 1
blara asked on 25 Mar 2008, 09:26 PM
Hello:

My Tooltip has a button and a list. My questions are:

1. How do I close the tooltip (sticky) once the button is clicked; and

2. How do I refresh the contents of the tooltip (a DataList) once the button is clicked?

Thanks

3 Answers, 1 is accepted

Sort by
0
blara
Top achievements
Rank 1
answered on 26 Mar 2008, 02:27 PM

Some additional info: I am just using the RadTooltip control (not the manager) and would like to accomplish these tasks server-side.

Thanks,
0
Accepted
Svetlina Anati
Telerik team
answered on 28 Mar 2008, 02:14 PM
Hello blara,

To your questions:

  1. I suggest to implement a javascript function which closes the active RadToolTip and after that call it server side. This should look like the following:

      function CloseActiveToolTip()  
            {   
                setTimeout(function(){   
                    var controller = Telerik.Web.UI.RadToolTipController.getInstance();  
                    var tooltip = controller.get_ActiveToolTip();  
                    if (tooltip) tooltip.hide();  
                }, 1000);  
            } 
     
    And in your code - behind:

      protected void Button1_Click(object sender, EventArgs e)  
        {  
            ClientScript.RegisterStartupScript(GetType(), "closeTip""CloseActiveToolTip();"true);  
        } 
  2. What exactly do you mean by refreshing a DataList server-side? In case you have made changes and want them to take effect you should databind the DataList by calling its DataBind() method in the button's event handler, just before you call the script.

I prepared a simple demonstration of the described approach for closing the active RadToolTip server-side - you can find it in the attached archive file.


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
blara
Top achievements
Rank 1
answered on 28 Mar 2008, 08:43 PM
Thanks much for your response. Please disregard my second question. The reason why the tooltip contents were not getting refreshed was because I had the DataList wrapped inside of an UpdatePanel. Doing an UpdatePanel.Update() refreshes the tooltip contents.

Thanks!
Tags
ToolTip
Asked by
blara
Top achievements
Rank 1
Answers by
blara
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or