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

Position set to center and Window Resize

5 Answers 134 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
mc2000
Top achievements
Rank 1
mc2000 asked on 22 Dec 2010, 07:20 PM
Is there a way to have the RadTooltip (relative to browser window, centered) change position on Window resize so that it is always centered (without having to do a refresh)? Thanks.

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Dec 2010, 07:11 AM
Hello,


Positioning a RadToolTip relative to the browser window can be achieved by setting the RelativeTo property to BrowserWindow and the Position property to the desired value.
Checkout the demo: ToolTip / Relative to


-Shinu.
0
mc2000
Top achievements
Rank 1
answered on 23 Dec 2010, 02:29 PM
Thanks for the answer, but I'm interested in window resize, not window load. I already have the properties set to BrowserWindow and center -- it just doesn't change when resizing the window unless I refresh afterwards. Regards.
0
Svetlina Anati
Telerik team
answered on 24 Dec 2010, 02:24 PM
Hello mc2000,

 The RadToolTip does not have a public client API which allows to move it around because the purpose of the control is to popup relative to an element. Despite this I prepared for you a sample demo which achieves what you need - you can find it attached.

Note, however, that it uses the private _setPopupVisible method and it is not recommended to use private methods because in case it changes on our side and upgrade you could face problems.

If you want you can use the provided solution or you could consider using  the RadWindow control which exposes a moveTo method.

I hope that my reply is helpful and I wish you happy holidays!

Best wishes,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Svetlina Anati
Telerik team
answered on 24 Dec 2010, 02:27 PM
Hi mc2000,

 I quick follow up - please, note that the provided code is just a simple demonstration on how to move the tooltip and you should use the logic as a start point and extend it further according to your scenario. One thing you might need is to check whether the tooltip is visible by using tooltip.isVisible() and then move it or check whether it has been created, etc.

Kind regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
mc2000
Top achievements
Rank 1
answered on 27 Dec 2010, 03:05 PM
Actually, with the upgrade caveat, this works exactly as I need it to...thank you. For anyone else who may be downloading this, do make sure you explicitly set the tooltip height and width. Mine was being sized by the containing content and, for this scenario, it will not work.
Tags
ToolTip
Asked by
mc2000
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
mc2000
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or