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

Can't assign ToolTipManager to Toolbarbuttons?

7 Answers 116 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
daviddam
Top achievements
Rank 1
daviddam asked on 19 Oct 2007, 07:58 PM
I have been unsuccessful figuring out how to assign a specific RadToolTipManager to my RadTollbarButtons on my toolbar. 

Can any one offer any code that might help?

Thanks!

7 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 23 Oct 2007, 01:45 PM
Hello daviddam,

You need to get the client IDs for the toolbar buttons and add them in the target collection:

<telerik:RadToolTipManager Position="BottomRight" ID="RadToolTipManager1" runat="server">  
    <TargetControls> 
        <telerik:ToolTipTargetControl IsClientID="true" TargetControlID="Radtoolbar1_tlbb1" /> 
        <telerik:ToolTipTargetControl IsClientID="true" TargetControlID="Radtoolbar1_tlbb2" /> 
        <telerik:ToolTipTargetControl IsClientID="true" TargetControlID="Radtoolbar1_tlbb3" /> 
    </TargetControls> 
</telerik:RadToolTipManager> 
<radTlb:RadToolbar runat="server" ID="Radtoolbar1">  
    <Items> 
        <radTlb:RadToolbarButton ID="tlbb1" ToolTip="New (Alt+N)" CommandName="New" /> 
        <radTlb:RadToolbarButton ID="tlbb2" ToolTip="Open (Alt+O)" CommandName="Open" /> 
        <radTlb:RadToolbarButton ID="tlbb3" ToolTip="Save (Alt+S)" CommandName="Save" /> 
    </Items> 
</radTlb:RadToolbar> 

Getting the ClientIDs for the RadToolBar buttons can also be done on the server in order to avoid searching for the exact id of the rendered element.



All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
daviddam
Top achievements
Rank 1
answered on 01 Nov 2007, 05:10 PM
How do I get the ClientID for the ToolbarButtons?  I am creating the buttons programmatically and then add them to the Toolbar.  The problem I am having is that once I create the button, the ClientID is null.

Any ideas?
0
Georgi Tunev
Telerik team
answered on 06 Nov 2007, 04:17 PM
Hello daviddam,

I've attached to this thread a small sample that shows how to achieve the desired scenario. Use it as a base and extend it further so it fits your requirements.




Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
daviddam
Top achievements
Rank 1
answered on 06 Nov 2007, 06:38 PM
Thank you for the sample project.  However, my problem still exists.  Here is a snippet of the code.  It is very similar to the code attached to this post.  However, if I put a breakpoint on the last line, button.ClientID is null so it does not find the control on the client side and I get the standard tooltip over the buttons rather than the fancy Telerik tooltip.  Is one of the settings below causing this problem?

Thanks!

RadToolbarButton button = new RadToolbarButton();  
button.EnableViewState = false;  
button.CommandName = "help" + kvp.Key;  
button.ButtonImage = "../../../../../Images/widget-help.gif";  
button.DisplayType = RadToolbarButton.ButtonDisplayType.ImageOnly;  
string tip = dtWidgets.DefaultView[0]["description"].ToString();  
button.ToolTip = tip;  
kvp.Value.Items.Add(button);  
this.RadToolTipManagerHelp.TargetControls.Add(kvp.Value.ClientID + "_" + button.ClientID, true);  
 
0
Tervel
Telerik team
answered on 07 Nov 2007, 04:13 PM
Hello daviddam,

Please note that in our sample the ID of each button is set explicitly - e.g.

 but.ID = "TLBBUT_" + counter;

while in your code no such thing occurs  - hence the problem you encoutner.


Greetings,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
AJ
Top achievements
Rank 1
answered on 11 Dec 2007, 01:47 PM
Hi Georgi,

I've this set up declaratively as you have. The problem I'm seeing is that both tooltips appear; the new RadTooltip and the old RadToolbarbutton tooltip.

Is there anyway to kill the old one?

thanks

Alan
0
Georgi Tunev
Telerik team
answered on 12 Dec 2007, 03:40 PM
Hi Alan,

This can be fixed with a small hack - please find attached the modified example to my post. We will improve the behavior of the RadToolBar control in one of the following releases and then this code will not be needed.




Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
daviddam
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
daviddam
Top achievements
Rank 1
Tervel
Telerik team
AJ
Top achievements
Rank 1
Share this question
or