This is a migrated thread and some comments may be shown as answers.

args.Value in method OnAjaxUpdate always the same in IE8

1 Answer 37 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Wouter
Top achievements
Rank 1
Wouter asked on 21 Dec 2011, 09:55 AM
Hi,

I've got a problem with the RadToolTipManager in IE8, FireFox and IE9 gives no problem.

When I try to show the tooltip, the OnAjaxUpdate method will fire, but in IE8 the args.Value will always be the same.
The repeater will update after the following javascript function that'll be called from a RadWindow.

function onStickyNotePopupSaved() {
  top.CloseWindowRadWindow('StickyNotePopupWindow');
  var ajaxPanel = $find('<% =RadAjaxPanel1.ClientID%>');
  ajaxPanel.ajaxRequest('');
}

I use the following Telerik version:  2011.2.712.40 (for .NET 4.0)

Has anyone an idea.

Kind regards,
Wouter Splinter

/// <summary>
/// load the usercontrol that shows the stickynotes content
/// </summary>
/// <param name="stickyNoteId"></param>
/// <param name="panel"></param>
private void UpdateToolTip(int stickyNoteId, UpdatePanel panel)
{
  var ctrl = Page.LoadControl("Controls/StickyNoteViewer.ascx");
  var stickyNoteView = (IStickyNoteViewerView)ctrl;
  stickyNoteView.StickyNoteId = stickyNoteId;
             
  panel.ContentTemplateContainer.Controls.Add(ctrl);           
}
 
/// <summary>
/// fires by the tooltipmanager, initiate the load of the customcontrol
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
{
  int stickyNoteId;
  if (int.TryParse(args.Value, out stickyNoteId))
  {
    UpdateToolTip(stickyNoteId, args.UpdatePanel);
  }
}
 
/// <summary>
/// bind the stickynote to the tooltipmanager
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void repeaterStickyNotes_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
  var stickyNoteControl = e.Item.FindControl("stickyNoteControl");
  var stickyNote = (StickyNote)e.Item.DataItem;
 
  RadToolTipManager1.TargetControls.Add(stickyNoteControl.ClientID, stickyNote.StickyNoteID.ToString(), true);
}

<telerik:RadToolTipManager runat="server" AnimationDuration="300" ShowDelay="200"
                                EnableShadow="true" HideDelay="1" ID="RadToolTipManager1" Width="463px" Height="220px"
                                RelativeTo="Element" Animation="Slide" Position="TopCenter" OnAjaxUpdate="OnAjaxUpdate"
                                Skin="Telerik" />
                            <asp:Repeater runat="server" ID="repeaterStickyNotes" OnItemDataBound="repeaterStickyNotes_ItemDataBound">
                                <ItemTemplate>
                                    <div style="text-align: left; margin-right: 5px; float: left;">
                                        <div runat="server" id="stickyNoteControl" style="width: 24px; height: 30px; background-position: center;
                                            background-repeat: no-repeat; background-image: url('/App_Themes/CROW/Images/Icon_Pin_Yellow.png');">
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 21 Dec 2011, 04:06 PM
Hi Wouter,

Please make sure you are also updating the RadToolTipManager in the AJAX request when you change the datasource for the grid. You also need to clear the old target controls collection. This is shown in the following online demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx. Note the AJAX settings that update the ToolTipManager as well and also the RadToolTipManager1.TargetControls.Clear(); call. In the demo it is in the grid's ItemCommand event, yet it should be called when the container that holds the targets rebinds in your scenario.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ToolTip
Asked by
Wouter
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or