How to make RadTooltipManager show tooltip on different control

2 posts, 0 answers
  1. Nikolay
    Nikolay avatar
    7 posts
    Member since:
    Jun 2011

    Posted 16 Jun 2011 Link to this post

    Hello.

    I make a user control and add RadTooltipManager on master page and OnLoad of my control I do next:
        /// <summary>
        /// Tooltip description
        /// </summary>
        public string Description
        {
            get;
            set;
        }   
     
    protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
     
            RadToolTipManager tooltipManager;
            tooltipManager = this.Page.Master.FindControl("tooltipManager") as RadToolTipManager;
            if (tooltipManager == null)
            {
                throw new ApplicationException("There are no Tooltip Manager on the page!");
            }           
            tooltipManager.TargetControls.Add(this.hplnkInfo.ClientID,Description,true);          
        }
    And when I initialize property Description of my control I see empty tooltip when click on control/
    I think TooltipTargetControlCollection.Add(string controlID,string val,bool isClientID) works like "val" is the tooltip which showing by RadTooltipManager near controlID control.
    Is it true?
    And how can I show different tooltip on different controls using one RadTooltipManager and passing to it tooltip message?

    Thank you.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 17 Jun 2011 Link to this post

    Hi Nikolay,

    The Value string that you can pass to the Add() method is just a value that the tooltip object can hold. Its purpose is to help the developer pass some information to the tooltip which can be used for databinding or some other custom logic that is invisible to the user. You can put this value in a public property in the user control that you load in the ToolTipManager in it OnAjaxUpdate event.

    This approach is shown in the following online demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx. Please note how this value is assigned to the ProductID in the RadGrid1_ItemDataBound method and is later passed to the user control in the OnAjaxUpdate event. In our demo we use it to databind the control, yet you can use it to populate a label, for example.

    I hope my reply was helpful.

    Greetings,
    Marin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top