Gotta be something simple I'm missing here.
I have a list view of Products. I also have a tooltip.
In the code behind I attach the tooltip to the product Image in the listview.
I then use the OnAjaxUpdate to load a user control to display the contents of the tooltip.
The problem is; it works great when I load the listview initially. However, if I rebind the list view with another set of products the OnAjaxUpdate still sends in the previous bound listview productIDs. I can see in the rlvWishlist_ItemDataBound that the new ProductID is being set in the target control add method, but when I invoke the tooltip by hovering over the image the args.Value is still the original bound set of data (ProductIDs).
I also tried clearing the tooltip target controls in the rlvWishlist_NeedDataSource, but that doesn't seem to work either.
Any help would be appreciated.
Thank you,
Tad
I have a list view of Products. I also have a tooltip.
| <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="ManualClose" MouseTrailing="true" |
| Width="450" runat="server" Animation="Resize" Sticky="true" EnableEmbeddedSkins="true" ShowCallout="true" OnAjaxUpdate="OnAjaxUpdate" Height="400" ContentScrolling="Auto" RelativeTo="Element" Skin="Telerik" AutoCloseDelay="0" Position="MiddleRight"> |
| </telerik:RadToolTipManager> |
In the code behind I attach the tooltip to the product Image in the listview.
| protected void rlvWishlist_ItemDataBound(object sender, RadListViewItemEventArgs e) |
| { |
| var target = e.Item.FindControl("rbiProduct"); |
| if (Equals(target, null)) return; |
| var item = (RadListViewDataItem) e.Item; |
| RadToolTipManager1.TargetControls.Add(target.ClientID, |
| e.Item.OwnerListView.DataKeyValues[item.DisplayIndex]["ProductID"].ToString(), |
| true); |
| } |
I then use the OnAjaxUpdate to load a user control to display the contents of the tooltip.
| protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
| { |
| UpdateToolTip(args.Value, args.UpdatePanel); |
| } |
| private void UpdateToolTip(string elementID, UpdatePanel panel) |
| { |
| var ctrl = Page.LoadControl("~/UserControls/ucProductDetail.ascx"); |
| panel.ContentTemplateContainer.Controls.Add(ctrl); |
| var productDetail = (ucProductDetail) ctrl; |
| rlvWishlist.Rebind(); |
| productDetail.ProductID = Convert.ToInt32(elementID); |
| } |
The problem is; it works great when I load the listview initially. However, if I rebind the list view with another set of products the OnAjaxUpdate still sends in the previous bound listview productIDs. I can see in the rlvWishlist_ItemDataBound that the new ProductID is being set in the target control add method, but when I invoke the tooltip by hovering over the image the args.Value is still the original bound set of data (ProductIDs).
I also tried clearing the tooltip target controls in the rlvWishlist_NeedDataSource, but that doesn't seem to work either.
Any help would be appreciated.
Thank you,
Tad