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

positioning

1 Answer 75 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 21 Jun 2010, 04:51 PM
Im starting to use the tooltip for the first time and have placed a tooltipmanager on my form.  Ive got the whole thing to work ok, its just that sometimes, when the tooltip initially appears, it displays in the far left of the page,then jumps over to the control that activated it.  How can I give the popup a consistent position ?

this is the code

<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" 
        AutoTooltipify="True" Skin="Sunset" OnAjaxUpdate="OnAjaxUpdate" Animation="Fade" RelativeTo="Mouse" HideEvent="LeaveToolTip">
    </telerik:RadToolTipManager>


in my c# I have several images that activate different popups

 this.RadToolTipManager1.TargetControls.Add(this.ImageGuarantee.ClientID, "Guarantee", true);
                this.RadToolTipManager1.TargetControls.Add(this.ImageWhy.ClientID, "Why", true);
                this.RadToolTipManager1.TargetControls.Add(this.ImageVIP.ClientID, "VIP", true);


protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);
        }
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("~/UserControls/PopupNarrative.ascx");
            panel.ContentTemplateContainer.Controls.Add(ctrl);
            UserControls.PopupNarrative pn = (UserControls.PopupNarrative)ctrl;
            pn.PopupNarrativeType = elementID;
        }


Ive tried setting it to relative to element, but it makes no difference

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 23 Jun 2010, 10:54 AM
Hi mww,

It is possible to get undesired position when there is not explicit width set and the OnAjaxUpdate event is used. However, this is expected behavior in such case - the content of the tooltip is loaded through AJAX and the tooltip cannot "predict" the width it has to have when it is shown. Thus it shows at some coordinates and after that the resize takes place and as a result the position is not the correct.

This being said, you should set the Width property explicitly and to use the ContentScrolling property to the desired value in order to determine the behavior when the width should be bigger than the set. If you want the tooltip to resize accordingly you should set it to Default.

We are currently working on improving this behavior but for the time being some explicit size set is the best solution for the case.



Sincerely yours,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolTip
Asked by
mww
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or