Problems with onajaxload and Radtooltipmanager

11 posts, 0 answers
  1. Jon Hobbs
    Jon Hobbs avatar
    48 posts
    Member since:
    May 2007

    Posted 27 May 2007 Link to this post

    Hi Guys,

    After sorting out my recent problems getting radtooltip to work inside a datalist I found out i can't use Load on Demand with a tootip, only with a tooltip manager so I have had to rewrite it all to get it working. However I am having lots of problems.

    First of all here is my code.

    1<%@ Page Language="VB" MasterPageFile="Master.master" %> 
    2<%@ MasterType  virtualPath="Master.master"%> 
    4<%@ Import Namespace="System.Configuration.ConfigurationManager" %> 
    5<%@ Import Namespace="System.Data" %> 
    6<%@ Import Namespace="System.Data.SqlClient" %> 
    7<%@ Import Namespace="System.collections.Generic" %> 
    8<%@ Import Namespace="Tvi" %> 
    10<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    14<script runat="server"
    16    Dim Reader As SqlDataReader 
    17    Dim Files As String = AppSettings("files_url") 
    19    Sub Page_Load() 
    21        MyRepeater.DataSource = Database.getDataReader("SELECT TOP 10 Caption, Thumbnail FROM Photos") 
    22        MyRepeater.DataBind() 
    24    End Sub 
    27    Sub MyRepeaterBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) 
    29        If e.Item.ItemType = ListItemType.AlternatingItem OrElse e.Item.ItemType = ListItemType.Item Then 
    31            Dim TempImage As Image = DirectCast(e.Item.FindControl("MyImage"), Image) 
    33            Dim ClientID As String = TempImage.ClientID 
    35            CommentToolTip.TargetControls.Add(ClientID, True) 
    37        End If 
    39    End Sub 
    42    Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs) 
    43        Dim elementID As String = args.TargetControlID 
    44        'Add content when necessary 
    45        args.UpdatePanel.ContentTemplateContainer.Controls.Add(New HtmlGenericControl("HR")) 
    46    End Sub 
    50<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server"
    51    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    53    <asp:UpdatePanel ID="UpdatePanel1" runat="server"
    54        <ContentTemplate> 
    57            <asp:repeater runat="server" id="MyRepeater" onitemdatabound="MyRepeaterBound"
    58                    <itemtemplate> 
    59                        <asp:image runat="server" id="MyImage" imageurl='<%# Files + DataBinder.Eval(Container.DataItem, "Thumbnail")%>'/> 
    60                    </itemtemplate> 
    61                </asp:repeater> 
    64        </ContentTemplate> 
    65    </asp:UpdatePanel> 
    67    <telerik:radtooltipmanager  
    68        runat="server"  
    69        id="CommentToolTip"  
    70        ManualClose="true" 
    71        Sticky="true"  
    72        Title="Hello"  
    73        Skin="Web20"  
    74        Width="350px"  
    75        Height="250px"  
    76        Position="MiddleRight"  
    77        OffsetX="6" 
    78        Animation="Fade"  
    79        OnAjaxUpdate="OnAjaxUpdate"
    80    </telerik:radtooltipmanager> 

    I should explain that line 21 uses a function of our own data layer. My problems are as follows....

    1) When i remove the OnAjaxUpdate="OnAjaxUpdate" the page works. It shows a blank tooltip when you click on each photo. However, when I add the OnAjaxUpdate back in it stops working. The tooltips show for half a second then disappear again.

    It does this in Firefox and IE and does it when i take all of the code out of the onajaxupdate sub too so the problem doesn't seem to be with the contents of that sub.

    2) Because I am now using a radtooltipmanager rather than a radtooltip inside the datalist i have no idea how to change the title of the tooltip to the "Caption" I am getting from the database. When I was using a tooltip in the datalist I just did this...

    Title='<%# DataBinder.Eval(Container.DataItem, "Caption") %>'

    3) I copied the OnAjaxUpdate Sub from a telerik example but have no idea what it is doing. WHy is ElementID declared and then not used ? And what is args.UpdatePanel.ContentTemplateContainer.Controls.Add ? Does the Tooltip have it's own updatepanel inside it ?

    Any help would be really appreciated as I just don't understand the online demos or the documentation. A very simple example would be useful to many others I'd guess.

    Thanks, Jon

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 30 May 2007 Link to this post

    Hi Jon,
    Straight to your questions:
    1. We are aware of this issue and our developers are currently working on it to provide a solution as soon as possible. The problem manifests when you try to use the Ajax (UpdatePanel in your case) and ToolTipManager with OnAjaxUpdate.
    2. In case you just add the elements to the TargetControls collection of the RadToolTipManager and specify their Title attribute (or ToolTip attribute) the way you have for the RadToolTip (without having OnAjaxUpdate), the content of the RadToolTip will equal the value of the Title (ToolTip) attribute. Once you decide you want to use the OnAjaxUpdate, you decide to manage the content of the RadToolTip on the server. Right before a RadToolTip open, the AjaxUpdate event fires and on the server , you get an UpdatePanel to which you can add controls that will appear in the RadToolTip.
    3. You only need the OnAjaxUpdate handler in case you want to add content to the RadToolTip after you execute some server code. In case you refer to the Load on demand example, the elementID used in the UpdateToolTip method.

    In order to get familiar with the RadToolTip control, I would recommend that you have a look at our online Help.

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jon Hobbs
    Jon Hobbs avatar
    48 posts
    Member since:
    May 2007

    Posted 30 May 2007 Link to this post

    Hi Tsvetie,

    Thanks for your answers. I am stull a little confused though (actually very confused).

    So, from answer 1 am I right in thinking that nobody is currently able to to use  onajaxupdate with a tooltipmanager ? If that is the case then how come your online demo  here works fine ?

    Do you have any idea when a fix might come ? I am trying to use it on a project with only 2 weeks to go so I need to know whether to use something different.

    Also, If I am reding your answer to question 2 correctly, are you saying that there is no way to programatically change the title of the tooltip when it is bound, I have to add my own title control as part of the onajaxupdate ? If so that makes sense.

    Thanks again, Jon

  4. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 31 May 2007 Link to this post

    Hi Jon,
    1. The online demo that you refer to does not use un UpdatePane to wrap the Repeater - that is why there is no problem with the example.
    2. I already sent you the hotfix.
    3. Yes, that is absolutely correct. With the OnAjaxUpdate handler, you update only the content of the RadToolTip. That is why you cannot change the Title.
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Jon Hobbs
    Jon Hobbs avatar
    48 posts
    Member since:
    May 2007

    Posted 31 May 2007 Link to this post

    Hi Tsvetie,

    Thank you for the Hotfix, it seemed to fix the problem in firefox but now I am getting a new problem.

    If i open the tooltips on my page lots of times, sometimes the page refresthes so there seems to be a postback happening. But it seems to be random and you have to click the tooltips open about 20-30 times before it seems to happen.

    Has anyone else had this problem ?

  6. Raj Kanaparti
    Raj Kanaparti avatar
    9 posts
    Member since:
    Apr 2007

    Posted 03 Jun 2007 Link to this post

    Hello :

    I have a RadAjaxPanel in which I have a GridView .In each gridView I have a ToolTip control that displays a user control. I am binding the Tooltip control to asp:button in DataRowbound event.
    When the Page first renders , I can click on the Button and the tooltip shows up with the user control. But when I have a post back say suppose clickling a check box in grid view , the tooltipControl doesnt work any more.

    Can you please let me know if some one has a solution to this problem.

  7. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 04 Jun 2007 Link to this post

    Hello Raj and Jon,
    Please open new support tickets and we will send you a hotfix that fixes the described problems.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Hanumesh
    Hanumesh avatar
    13 posts
    Member since:
    Apr 2007

    Posted 14 Jun 2007 Link to this post


    I am using RADtooltipManager in RADGrid, I am adding RadGrid column values(client IDs) as targetControld for Tooltip Manager in Grid's ItemDataBound Event and in AjaxUpdate event am loading a usercontrol into the update panel. so, when I mouse over to any item in the grid am getting a tooltip for that element. But I too have a button in my grid and on click its submitting the page. After postback of the page tooltip is not working.
    I found that on submit of the page its not calling ItemDataBound event of the grid where I am adding targetcontrols to Tooltip manager. Is this the cause for tooltip not working on postback?

    I appreciate if anybody suggest some solution.

  9. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 14 Jun 2007 Link to this post

    Hello Hanumesh,
    Indeed this is causing the problem. We have updated the RadToolTipManager so that it persists its TargetControls collection across postbacks. Please have a look at the other forum thread, where you asked the same question for the hotfix.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Simerpreet
    Simerpreet avatar
    8 posts
    Member since:
    Jul 2010

    Posted 19 Jul 2010 Link to this post

    Hi ...I am facing the same issue as specified in point 1.....Can anyone please send me the hot fix provided for the same....Any help will be appreciated...
  11. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 20 Jul 2010 Link to this post

    Hello Hanumesh,

    This thread has been opened 3 years ago and a lot of things has changed in RadToolTip and RadControls. What I suggest is to upgrade to a later or best the latest version of RadControls and everything should work fine. Hotfixes are provided only as a temporary solution while the fix is available in an official release and this is the case with the mentioned problem.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top