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

How to set a tooltip to radwindow from java Script

1 Answer 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sabrina Schubert
Top achievements
Rank 1
Sabrina Schubert asked on 01 Jun 2010, 11:38 PM
Hi,

My requirement is to display a tool-tip for  a radwindow when i mouse hover the window? Can somebody suggest us on how to implement this?

Cheers,
Sabrina

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 04 Jun 2010, 02:01 PM
Hello Sabrina,

Your scenario is possible only when the RadWindow's content is set through its <ContentElement>. If this is your case the solution should looks like this:
<telerik:RadWindow ID="RadWindow1" runat="server">
    <ContentTemplate>
        <label>
            RadWindowContent</label>
    </ContentTemplate>
</telerik:RadWindow>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" RelativeTo="Mouse"
    MouseTrailing="true" Text="RadWindow1">
</telerik:RadToolTipManager>
<asp:Button ID="Button2" runat="server" Text="Open RadWindow" OnClientClick="openRadWindow(); return false;" />
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function openRadWindow()
        {
            var oWindow = $find("<%= RadWindow1.ClientID %>");
            oWindow.show();
            showWindowToolTip(oWindow);
        }
 
        function showWindowToolTip(oWindow)
        {
            var radToolTipManager = $find("<%= RadToolTipManager1.ClientID %>");
            var radToolTip = radToolTipManager.getToolTipByElement(oWindow.get_popupElement());
            if (!radToolTip)
            {
                var radToolTip = radToolTipManager.createToolTip(oWindow.get_popupElement());
            }
        }
    </script>
</telerik:RadScriptBlock>

Please note that if you load a different document in RadWindow control (using NavigateUrl property) you can set tooltip only to the RadWindow's elements like command buttons for example. The tootltip will not be shown when the mouse is over the RadWindow's content.

I hope this helps.

All the best,
Fiko
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
Window
Asked by
Sabrina Schubert
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or