Both RadTooltip and RadTooltipManager can display rich content (including user controls and other ASP.NET controls).
RadTooltip
Rich content can be added to RadTooltip can be set to the tooltip in two ways:
1. Declaring it between the opening and closing tags, e.g.:
<
telerik:RadToolTiprunat
=
"server"
ID
=
"RadToolTip1"
Width
=
"250px"
Height
=
"300px"
>
2. Adding controls from the code-behind to the RadToolTip.Controls collection, e.g:
this
.RadToolTip1.Controls.Add(newHtmlGenericControl(
"HR"
));
RadTooltipManager
RadTooltipManager supports the OnAjaxUpdate event, which triggers an AJAX call to the server when the user moves the mouse over a particular tooltip element on the client.
The event handler receives the ID of the client element being hovered. This allows for dynamically loading and displaying rich data content for a particular element on demand.
The feature helps keep page sizes small and manageable, allowing for rich content to be sent to the client only if requested.
The elements for which RadTooltipManager will throw an AJAX event on the server must have their ClientID's added to the TargetControls collection.
<
telerik:RadToolTipManager
runat
=
"server"
ID
=
"RadToolTipManager1"
Width
=
"250px"
Height
=
"300px"
Animation
=
"Resize"
OnAjaxUpdate
=
"OnAjaxUpdate"
>
<
TargetControls
>
<
telerik:ToolTipTargetControl
TargetControlID
=
"Link1"
IsClientID
=
"true"
Value
=
"ValueForLink1"
/>
<
telerik:ToolTipTargetControl
TargetControlID
=
"Link2"
IsClientID
=
"true"
Value
=
"ValueForLink2"
/>
</
TargetControls
>
</
telerik:RadToolTipManager
>
Target controls can also be added from the codebehind in the following manner:
RadToolTipManager1.TargetControls.Add(image.ID) ;
//The server ID is taken into consideration
RadToolTipManager1.TargetControls.Add(image.ClientID,
true
) ;
//The client ID is taken into consideration
RadToolTipManager1.TargetControls.Add(image.ClientID,
"Value"
,
true
) ;
//A specific value is associated with this target