Hi,
we're about buying subscription renewal so we're testing AJAX components. So far, we're fully excited about it, great work.
We were trying to accomplish specific ToolTip implementation, but with no avail.
Our goal
To have paginated Repeater (Int32 list as DataSource) inside ajaxified panel using RadAjaxManager, HyperLink in each item has attached ajaxified tooltip via RadToolTipManager, that simply displays its Int32 value. When page gets changed, TargetControls should be reinitiated (as your demos demonstrate). Thus, I placed the RadToolTipManager into UpdatedControls collection of RadAjaxManager, too. But here it goes. When I put mouse over the item, the ToolTip just blinks and disappeared. When I remove RadToolTipManager from UpdatedControls, values are displayed correctly. But the tooltip does not get updated when page change occurs.
My simplified code is attached below:
TestToolTip.aspx
TestToolTip.aspx.cs
Thanks very much for any help.
we're about buying subscription renewal so we're testing AJAX components. So far, we're fully excited about it, great work.
We were trying to accomplish specific ToolTip implementation, but with no avail.
Our goal
To have paginated Repeater (Int32 list as DataSource) inside ajaxified panel using RadAjaxManager, HyperLink in each item has attached ajaxified tooltip via RadToolTipManager, that simply displays its Int32 value. When page gets changed, TargetControls should be reinitiated (as your demos demonstrate). Thus, I placed the RadToolTipManager into UpdatedControls collection of RadAjaxManager, too. But here it goes. When I put mouse over the item, the ToolTip just blinks and disappeared. When I remove RadToolTipManager from UpdatedControls, values are displayed correctly. But the tooltip does not get updated when page change occurs.
My simplified code is attached below:
TestToolTip.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestToolTip.aspx.cs" Inherits="TestToolTip" %> |
<!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"> |
<asp:ScriptManager ID="sman" runat="server" /> |
<telerik:RadAjaxManager ID="aman" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="pnlList"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="pnlList" /> |
<telerik:AjaxUpdatedControl ControlID="tooltip1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<div style="padding: 30px; border: 1px solid #000"> |
<telerik:RadToolTipManager ID="tooltip1" runat="server" RelativeTo="Mouse" |
Skin="Black" Width="50" Height="50" Position="MiddleRight" OnAjaxUpdate="OnUpdate" /> |
<asp:Panel ID="pnlList" runat="server"> |
<asp:Repeater ID="list1" runat="server" OnItemDataBound="OnItemBound"> |
<ItemTemplate> |
<asp:LinkButton ID="lnk1" runat="server" Text="Test" />, <%# Container.DataItem %><br /> |
</ItemTemplate> |
</asp:Repeater> |
<asp:LinkButton ID="prev" runat="server" Text="prev" OnClick="OnMovePageMinus" /> | |
<asp:LinkButton ID="next" runat="server" Text="next" OnClick="OnMovePagePlus" /> |
</asp:Panel> |
</div> |
</form> |
</body> |
</html> |
TestToolTip.aspx.cs
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 TestToolTip : System.Web.UI.Page |
{ |
protected const int PageSize = 4; |
protected int PageIndex |
{ |
get { |
if (ViewState["PageIndex"] == null) |
{ |
ViewState["PageIndex"] = 0; |
} |
return (int)ViewState["PageIndex"]; |
} |
set {ViewState["PageIndex"] = value;} |
} |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!IsPostBack) |
{ |
LoadList(); |
} |
} |
protected void LoadList() |
{ |
tooltip1.TargetControls.Clear(); |
List<int> ints = new List<int>(){ 1, 2, 3, 4, 5, 6, 7 }; |
List<int> source = new List<int>(); |
for (int i = PageIndex * PageSize; i < (PageIndex * PageSize) + PageSize && i < ints.Count; i++) |
{ |
source.Add(ints[i]); |
} |
list1.DataSource = source; |
list1.DataBind(); |
} |
protected void OnItemBound(object sender, RepeaterItemEventArgs e) |
{ |
if (e.Item.DataItem == null) return; |
Control lnk1 = e.Item.FindControl("lnk1"); |
tooltip1.TargetControls.Add(lnk1.ClientID, e.Item.DataItem.ToString(), true); |
} |
protected void OnUpdate(object sender, ToolTipUpdateEventArgs e) |
{ |
e.UpdatePanel.ContentTemplateContainer.Controls.Add(new LiteralControl(e.Value)); |
} |
protected void OnMovePageMinus(object sender, EventArgs e) |
{ |
PageIndex--; |
LoadList(); |
} |
protected void OnMovePagePlus(object sender, EventArgs e) |
{ |
PageIndex++; |
LoadList(); |
} |
} |
Thanks very much for any help.