Stop running script issue in IE8 with use of RadToolTip in RadGrid

4 posts, 0 answers
  1. Satish
    Satish avatar
    10 posts
    Member since:
    Oct 2013

    Posted 21 Oct 2013 Link to this post

    Hi ,
    We used radTooltip in Rad Grid ItemTemplate , the issue here if we load more data on grid we are getting below error in IE8 only.
    "Stop running the script"
     <telerik:GridTemplateColumn DataField="Mon6" UniqueName="Mon6" Visible="false" ItemStyle-CssClass="account_Headcol">
       <ItemTemplate>
    <asp:HyperLink ID="Mon6HLnk" runat="server" Visible="false"></asp:HyperLink>
    <asp:Label runat="server" Text="" ID="Mon6Lbl"></asp:Label>
     <telerik:RadToolTip runat="server" ID="radTooltip6"  ShowEvent="OnMouseOver"  HideEvent="LeaveToolTip"  IsClientID="true" >
     <asp:Label runat="server" ID="lblTooltipText6"></asp:Label>
      </telerik:RadToolTip>
      </ItemTemplate>
    </telerik:GridTemplateColumn>

    And Binding Tooltip data in ItemDataBound event of RadGrid like below

    Dim lab As Label = CType(gridDataItem("Mon" & i).FindControl("lblTooltipText" & i), Label)
    lab.text="<htm><table><tr><td>data 1</td></tr><tr><td>data 2</td></tr></table></html>"

    but if won't use RadTooltip i am not getting the issue,Please help me how to fix the issue with RadTooltips


  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 22 Oct 2013 Link to this post

    Hello Satish,

    Such an error is usually due to the presence of a RadToolTIpManager with AutoTooltipify set to true. It has to go through all elements on the page and attach handlers to the needed ones (elements with title/alt attribute), so when you have a very large grid (e.g. 500 rows and 20 columns which results in over 10 000 elements just from the grid) and a very slow browser (like IE8) it will take a lot of time for this operation to complete. There is no possible workaround for this apart from reducing the page size, because such automated operation will always come at some performance cost.

    In case you can confirm you have no tooltipManager, this problem would be rather strange. Standalone RadToolTips also attach handlers to their targets when the pages loads, but for a performance problem to occur you would need thousands of tooltips so that the event handler addition becomes noticeable. If the sheer number of controls is the case reducing the page size would be, perhaps, the easier option.

    What I suspect is a problem is the fact that you add <html> tags in the label, which is invalid, so you can try removing them to see if this helps.

    I cannot really be sure what is happening because there is no target defined for your tooltips in the code snippets you pasted, so I can only guess.

    On performance optimization for RadToolTips I can suggest another approach, however. You can use the client-side API of a RadToolTIpManager to dynamically create tooltips when mouse events are fired for their targets. This will let you avoid having several thousand event handlers added at the same time on page initialization: http://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx. If the targets have a title attribute set it will automatically become content for their RadToolTip, so you do not need to define a load-on-demand scenario.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Satish
    Satish avatar
    10 posts
    Member since:
    Oct 2013

    Posted 22 Oct 2013 Link to this post

    Hi Marin,
    thanks for your update
    we are not used any RadToolTIpManager in app, we just used RadToolTip for each item as i mentioned in Previous Mail.
    and also we defined TargetId for radTooltips which i was not posted in previous mail.
    code looks like below (below code is in ItemDataBound event of radGrid)

    Dim radtooltip As New RadToolTip = CType(gridDataItem("Mon" & i).FindControl("radtooltip" & i), RadToolTip)
    radtooltip.IsClientID = True

    radtooltip.TargetControlID = CType(gridDataItem("Mon" & i).FindControl("Mon" & i & "Lbl"), Label).ClientID

    we need <html> tags to apply the styles for label data which is in radtooltip

    The same code is working fine if we load less data on Grid.
    is there any way to find solution without implementing Pagination in RadGrid.Please help me in finding the solution.

    Thanks,
    Satish

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 23 Oct 2013 Link to this post

    Hi Satish,

    Have you actually examined my previous post?
    - Having additional html tags in the page is invalid according to HTML specifications, just t run a page with such content through a validator: http://validator.w3.org/.
    - CSS (classes and then cascades) are what is commonly used for styling content.
    - when having thousands of such controls in a slow browser (i.e. thousands of rows in a grid), attaching this many event handlers can cause the browser to show such a warning. The way to go (if you do not want to reduce the grid page size) is to create tooltips only when needed, and not for all elements at once. This is done via a RadToolTipManager and its client-side API.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
Back to Top