Tooltip on dockcommand

2 posts, 0 answers
  1. Sentia
    Sentia avatar
    12 posts
    Member since:
    Jul 2007

    Posted 05 Aug 2007 Link to this post

    Could you guys suggest a way of activating the radtooltip when a user clicks a dockcommand? thanks
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 07 Aug 2007 Link to this post

    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
Back to Top