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

Tooltip on dockcommand

1 Answer 72 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Sentia
Top achievements
Rank 1
Sentia asked on 06 Aug 2007, 02:00 AM
Could you guys suggest a way of activating the radtooltip when a user clicks a dockcommand? thanks

1 Answer, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 07 Aug 2007, 07:03 AM
Hi,

The following code will add tooltip to RadDock custom command when the button "SetTooltip" is clicked:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %> 
<%@ Register TagPrefix="rad" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
      <script type="text/javascript">  
      function setTooltip()  
      {  
           var titlebar = $find('RadDock1_T');  
           document.getElementById('RadDock1_T').getElementsByTagName("span")[0].childNodes[0].id="dock1CustomCommand";             
             
           var tooltip = $find("RadTooltip1");             
           tooltip.set_TargetControlID("dock1CustomCommand");  
      
      }  
      </script>          
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
     <div> 
        <rad:RadDock ID="RadDock1" runat="server">  
            <Commands> 
                <rad:DockCommand Name="CustomCommand" />   
            </Commands> 
        </rad:RadDock> 
        <rad:RadToolTip ID="RadTooltip1" runat="server">  
         RadTooltip1   
        </rad:RadToolTip> 
        <input type="button" onclick="setTooltip()" value="SetTooltip" /> 
    </div> 
    </form> 
    
</body> 
</html> 
 


I hope it will help you to achieve your goals.


Best wishes,
Petio Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
Sentia
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Share this question
or