Refreshing Tooltip Dynamically

4 posts, 1 answers
  1. blara
    blara avatar
    12 posts
    Member since:
    Jan 2006

    Posted 25 Mar 2008 Link to this post

    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
  2. blara
    blara avatar
    12 posts
    Member since:
    Jan 2006

    Posted 26 Mar 2008 Link to this post


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

    Thanks,
  3. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 28 Mar 2008 Link to this post

    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
  4. blara
    blara avatar
    12 posts
    Member since:
    Jan 2006

    Posted 28 Mar 2008 Link to this post

    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!
Back to Top