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

Using ToolTipManager and changing the ToolTip position

2 Answers 72 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 02 Jun 2009, 08:40 AM
The 'problem' with using ToolTipManager (TTM) is that you have to apply the same settings to all of the tooltips on the page (or so it seems to me).

I thought to change that using code like this ...
        protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e) 
        { 
            Label l = new Label(); 
            switch (e.TargetControlID) 
            { 
                case "dpCreateDate"
                case "dpPublicationDate"
                case "dpReviewDate"
                    RadToolTipManager1.Position = Telerik.Web.UI.ToolTipPosition.MiddleRight; 
                    break
 
                default
                    RadToolTipManager1.Position = Telerik.Web.UI.ToolTipPosition.BottomCenter; 
                    break
            } 
        } 
Needless to say, it doesn't appear to work; the default case seems to try and display something but I couldn't say what; the other case just causes the standard tooltips to appear.

Is it possible to do what it is I'm attempting?

--
Stuart

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 03 Jun 2009, 11:28 AM
Hello Stuart,

I can suggest you the following options to achieve the desired result:

  1. Set the position on the client in the OnClientBeforeShow event as shown below:

     <script type="text/javascript">  
            function OnClientBeforeShow(sender, args)  
            {  
                sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomCenter);       
            }  
            </script> 

    You can use the client API to get the target control ID, check it and set the desired position.
  2. You can use separate RadToolTip controls for your target elements and set different position to each of them.
  3. You can use a few RadToolTipManager with different position set - this will not make your page very heavy since the HTML rendered by the RadToolTipManager control is very little and this will not influence the performance.

I hope that my suggestions are helpful.


All the best,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stuart Hemming
Top achievements
Rank 2
answered on 03 Jun 2009, 11:45 AM
Svetlina,

1. Cool.
2. Not ideal, but yes, I see.
3. I've got that used to using 1 'manager' per page (Ajax, Window) that using more than one for tooltip never occurred to me. Nice one.

Thanks.

--
Stuart
Tags
ToolTip
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or