RadToolTipManager
The
RadToolTipManager control is useful in three scenarios:
- When the developer wishes to 'tooltipify' all HTML elements on page with title attribute. This is the scenario where the developer already has a page with existing tooltips that need to be easily converted to a nicer look (using a particular skin or animation effect). Dropping a RadToolTipManager on the page, without any additional configuration covers this scenario.
- When a list of elements should be tooltipified. In this case the RadToolTipManager TargetControls should be used. This scenario allows for finer tuning, and for using more than one RadToolTipManager - each configured differently (e.g. using different skins, different animations, different sizes).
- When one or more elements should display rich dynamic content to be fetched from the server.
Again the TargetControls collection should be used (as in the above scenario). This approach is useful in cases where content should be fetched from a data source, depending on the element being targeted, and helps keep pages smaller.
Using the TargetControls property
The
TargetControls property specifies a list of client ID's of elements that should be 'tooltipified'. The elements' 'title' attribute is used to obtain information for the tooltip content.
It can be used both declaratively on the page - e.g.
<telerik:RadToolTipManager runat="server" ID="RadToolTipManager1"
OnAjaxUpdate="OnAjaxUpdate">
<TargetControls>
<telerik:ToolTipTargetControl TargetControlID="Link1" IsClientID="true" />
<telerik:ToolTipTargetControlTargetControlID="Link2" />
</TargetControls>
</telerik:RadToolTipManager>
and in the codebehind:
this.RadToolTipManager2.TargetControls.
Add("link1");
By default, the
RadToolTipManager assumes that the ids in the controls collection are set to the server ids of the elements.
In case the ids are clientside (such as when elements are pure HTML and not server control, then
IsClientID="true" should be used.
Note: When adding client id's from the serverside, for example, in a scenario with a repeater, the overloaded Add method that takes two arguments should be used.
string clientID = ctrl.ClientID;
this.RadToolTipManager2.TargetControls.
Add(clientID,
true);