Can't assign ToolTipManager to Toolbarbuttons?

8 posts, 0 answers
  1. daviddam
    daviddam avatar
    7 posts
    Member since:
    Jan 2007

    Posted 19 Oct 2007 Link to this post

    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!
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 23 Oct 2007 Link to this post

    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
  3. daviddam
    daviddam avatar
    7 posts
    Member since:
    Jan 2007

    Posted 01 Nov 2007 Link to this post

    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?
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 06 Nov 2007 Link to this post

    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
  5. daviddam
    daviddam avatar
    7 posts
    Member since:
    Jan 2007

    Posted 06 Nov 2007 Link to this post

    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);  
     
  6. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 07 Nov 2007 Link to this post

    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
  7. AJ
    AJ avatar
    8 posts
    Member since:
    Nov 2007

    Posted 11 Dec 2007 Link to this post

    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
  8. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 Dec 2007 Link to this post

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