Problem adding tooptip on the client-side

3 posts, 1 answers
  1. Eduardo
    Eduardo avatar
    30 posts
    Member since:
    Feb 2009

    Posted 18 Jun 2009 Link to this post

    Hi,

    I'm having problems to set the tooltip of a button in the RadToolbar on the client side. I have to add buttons to a dropdown item in a toolbar, and I wanted to set the tooltip, but somehow, the set_toolTip function is not working.

    Here is the code I'm using:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="toolbarThinLastButton.aspx.cs" Inherits="toolbarThinLastButton" %> 
    <%@ Register TagPrefix="telerik" 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 Clicked() { 
                var taskbar = $find("RadToolBar1"); 
                var dd = taskbar.findItemByText("xxx"); 
     
                taskbar.trackChanges(); 
     
                var dropDownChildButton = new Telerik.Web.UI.RadToolBarButton(); 
                dropDownChildButton.set_text("a button"); 
                // Tooltip 
                dropDownChildButton.set_toolTip("bla bla bla"); 
                dd.get_buttons().add(dropDownChildButton); 
     
                taskbar.commitChanges(); 
            } 
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="scriptManager1" runat="server" /> 
        <div> 
            <telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Office2007" OnClientButtonClicked="Clicked"
                <Items> 
                    <telerik:RadToolBarButton Text="button 1" /> 
                    <telerik:RadToolBarButton Text="button 2" /> 
                    <telerik:RadToolBarButton Text="button 3" /> 
                    <telerik:RadToolBarDropDown Text="xxx"
                        <Buttons> 
                            <telerik:RadToolBarButton Text="add or remove buttons" ToolTip="click me"
                            </telerik:RadToolBarButton> 
                        </Buttons> 
                    </telerik:RadToolBarDropDown> 
                </Items> 
            </telerik:RadToolBar> 
        </div> 
        </form> 
    </body> 
    </html> 
     

    Maybe I'm missing something?

    Thanks,
    Eduardo

  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 19 Jun 2009 Link to this post

    Hello Eduardo,

    We are aware of this problem. Until we fix it please use the following workaround:

    <script type="text/javascript">  
        function Clicked() {  
            var taskbar = $find("RadToolBar1");  
            var dd = taskbar.findItemByText("xxx");  
     
            taskbar.trackChanges();  
     
            var dropDownChildButton = new Telerik.Web.UI.RadToolBarButton();  
            dropDownChildButton.set_text("a button"); 
            // Tooltip  
             
            dd.get_buttons().add(dropDownChildButton); 
            dropDownChildButton.get_linkElement().title = "bla bla bla";   
            taskbar.commitChanges();  
        }  
    </script> 

    I hope this helps.

    Kind regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eduardo
    Eduardo avatar
    30 posts
    Member since:
    Feb 2009

    Posted 19 Jun 2009 Link to this post

    Hello Veselin,

    That worked perfect! Thanks!

    Eduardo
Back to Top