I have a requirement to implement "Tooltip" in html table row. In order to implement Tooltip functionality i have used RadToolTipManager, here i am getting tooltip while hovering on html table row, but unable to populate value in the tooltip, as AjaxUpdate event which i have declared in Customer.ascx.cs file is not working -
RadToolTipManager1= this.Page.Master.FindControl("RadToolTipManager1") as RadToolTipManager
RadToolTipManager1.AjaxUpdate += new ToolTipUpdateEventHandler(RadToolTipManager_AjaxUpdate);
Please help me in calling AjaxUpdate event in Customer.ascx.cs file so that i can update my Tooltip with the values coming from DB without using webservice.
I am giving code that i tried to implement Tooltip functionality. for reference -
Master page -
<
telerik:RadToolTipManager
RenderMode
=
"Lightweight"
ID
=
"RadToolTipManager1"
Width
=
"400px"
Height
=
"200px"
ContentScrolling
=
"Auto"
HideEvent
=
"ManualClose"
RelativeTo
=
"Element"
Position
=
"BottomCenter"
runat
=
"server"
IgnoreAltAttribute
=
"true"
></
telerik:RadToolTipManager
>
In script Tooltip.js file -
showToolTip: function (element) {
var tooltipManager = telerikDemo.tooltipManager;
//If the user hovers the image before the page has loaded, there is no manager created
if (!tooltipManager) return;
////Find the tooltip for this element if it has been created
var tooltip = tooltipManager.getToolTipByElement(element);
//Create a tooltip if no tooltip exists for such element
if (!tooltip) {
tooltip = tooltipManager.createToolTip(element);
//Use the fact that the image was named after a country
//Extract the country name from the image, and set it as the value to be supplied to the web-service
tooltip.set_targetControlID(element.id)
}
//Let the tooltip's own show mechanism take over from here - execute the onmouseover just once
element.onmouseover = null;
//show the tooltip
setTimeout(function () {
tooltip.show();
}, 10);
}
Customer.ascx
<
tr
id
=
"Amount"
onmouseover
=
'telerikDemo.showToolTip(this)'
>
<
td
>
<%# Decimal.Parse(Eval("Amount").ToString()) <
0
? String.Format("({0:N})", Math.Abs(Decimal.Parse(Eval("Amount").ToString()))) :String.Format("{0:N}", Decimal.Parse(Eval("Amount").ToString()))%>
</
td
>
</
tr
>
Customer.ascx.cs
public partial class Customer: System.Web.UI.UserControl{
protected RadToolTipManager RadToolTipManager1;
protected void Page_Load(object sender, EventArgs e)
{
RadToolTipManager1= this.Page.Master.FindControl("RadToolTipManager1") as RadToolTipManager;
RadToolTipManager1.AjaxUpdate += new ToolTipUpdateEventHandler(RadToolTipManager_AjaxUpdate);
}
protected void RadToolTipManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
AjaxUpdate is not working.
}
}
I tried to implement above "Tooltip" functionality by referring below link.
https://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx
Thanks in advance.
Aditya