I have RadChart inside tooltip as follows:
The LiteralControl in the tooltip, as expected, displays TargetID depending on which item I hover. The chart, however, always display the first item hovered. If Item2 was hovered first, the legend in the chart will always be link2; similarly, if I hover item1 first, the legend in the chart will always be link1 afterwards. The chart just doesn't seem to be updated on each OnAjaxUpdate() call. Please help. Thanks,
Peichung
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ToolTipChart.aspx.cs" Inherits="WebApp_Test_ToolTipChart" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:ScriptManager ID="uxScriptManager" runat="server" /> |
<a href="#" id="link1">link1</a> |
<a href="#" id="link2">link2</a> |
<telerik:RadToolTipManager runat="server" ID="uxToolTipManager" |
Width="250px" |
Height="100px" |
Animation="Fade" |
Position="BottomRight" |
RelativeTo="Mouse" |
Sticky="true" |
ManualClose="true" |
OnAjaxUpdate="OnAjaxUpdate"> |
<TargetControls> |
<telerik:ToolTipTargetControl IsClientID="true" TargetControlID="link1" /> |
<telerik:ToolTipTargetControl IsClientID="true" TargetControlID="link2" /> |
</TargetControls> |
</telerik:RadToolTipManager> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
using Telerik.Web.UI; |
public partial class WebApp_Test_ToolTipChart : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void OnAjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs args) |
{ |
args.UpdatePanel.ContentTemplateContainer.Controls.Add(new LiteralControl("<div>" + args.TargetControlID + "</div>")); |
RadChart chart = new RadChart(); |
chart.Series.Add(new Telerik.Charting.ChartSeries()); |
chart.Series[0].Name = args.TargetControlID; |
args.UpdatePanel.ContentTemplateContainer.Controls.Add(chart); |
} |
} |
The LiteralControl in the tooltip, as expected, displays TargetID depending on which item I hover. The chart, however, always display the first item hovered. If Item2 was hovered first, the legend in the chart will always be link2; similarly, if I hover item1 first, the legend in the chart will always be link1 afterwards. The chart just doesn't seem to be updated on each OnAjaxUpdate() call. Please help. Thanks,
Peichung