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

How to make RadTooltipManager show tooltip on different control

1 Answer 65 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Nikolay
Top achievements
Rank 1
Nikolay asked on 16 Jun 2011, 01:43 PM
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.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Jun 2011, 02:32 PM
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.

Tags
ToolTip
Asked by
Nikolay
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or