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

Problem adding tooptip on the client-side

2 Answers 86 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Eduardo
Top achievements
Rank 1
Eduardo asked on 18 Jun 2009, 04:44 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 19 Jun 2009, 09:26 AM
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.
0
Eduardo
Top achievements
Rank 1
answered on 19 Jun 2009, 01:11 PM
Hello Veselin,

That worked perfect! Thanks!

Eduardo
Tags
ToolBar
Asked by
Eduardo
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Eduardo
Top achievements
Rank 1
Share this question
or