Problem with RadTooltipManager

4 posts, 0 answers
  1. Lance
    Lance avatar
    49 posts
    Member since:
    May 2008

    Posted 29 Jun 2008 Link to this post

    Hello,
    I am trying to switch a UserControl from using the RadToolTip to using the RadToolTipManager with load on demand.  I had the page working with the regular tooltip, but now it pops up the tooltip window, but it is just blank (the on demand control never shows). 
    I can set break points and see that the control loads, and the properties are being set, but the preRender event never fires (I don't know if needs to in this case).
    Anyway, I don't get any errors, the control just doesn't display.  I must be doing something stupid, but I can't figure out what it is.

    Here is the ascx code:

    <

    telerik:RadToolTipManager ID="RadToolTipManager1"
    Width="360" Height="288" Animation="Slide"
    Position="MiddleRight" Sticky="true" AutoCloseDelay="1000"
    OnAjaxUpdate="OnAjaxUpdate" runat="server">
    </
    telerik:RadToolTipManager>


    Here is the .vb code

    Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)
    Me.UpdateToolTip(args.Value, args.UpdatePanel)
    End Sub

    Private Sub UpdateToolTip(ByVal contextKey As String, ByVal panel As UpdatePanel)

    If contextKey = "" Then Exit Sub
    Try
    Dim ctrl As Control = Page.LoadControl("~/App_WebUserControls/bpThumbnail.ascx")
    Dim bigThumbnail As App_WebUserControls_bpThumbnail = DirectCast(ctrl, App_WebUserControls_bpThumbnail)
    bigThumbnail.AltText = contextKey
    Finally
    End Try
    End Sub

  2. Lance
    Lance avatar
    49 posts
    Member since:
    May 2008

    Posted 29 Jun 2008 Link to this post

    Oops, I thought I found the problem, but no joy.
    I realize that in my attempts to figure this out, I deleted the :

    panel.ContentTemplateContainer.Controls.Add(ctrl)

    I readded it so the .vb code now looks like this, but it still does not work:

    Private Sub UpdateToolTip(ByVal contextKey As String, ByVal panel As UpdatePanel)

    If contextKey = "" Then Exit Sub
    Try
    Dim ctrl As Control = Page.LoadControl("~/App_WebUserControls/bpThumbnail.ascx")
    Dim bigThumbnail As App_WebUserControls_bpThumbnail = DirectCast(ctrl, App_WebUserControls_bpThumbnail)
    bigThumbnail.AltText = contextKey
    panel.ContentTemplateContainer.Controls.Add(ctrl)
    Finally
    End Try
    End Sub

     

  3. Lance
    Lance avatar
    49 posts
    Member since:
    May 2008

    Posted 29 Jun 2008 Link to this post

    Ok,
    I found the solution although I need to do some tweeking still I think.

    Previously, I had it structured like this:
    • Page
      • WebUserControl with radtooltipmanager, and target control
        • Control returned from ajaxupdate on WebUserControl

    I changed it to:

    • Page with radtooltipmanager
      • WebUserControl target control
        • Control returned from ajaxUpdate on page

    So, essentially I had to move the radtooltipmanager outside the usercontrol, and into the page, and then it started working...

  4. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 01 Jul 2008 Link to this post

    Hello Lance,

    The last approach that you took is the recommended one. It guarantees there is one RadToolTipManager on the page, and it is a part of the page lifecycle, rather than of the user control lifecycle. This is very important (and much simpler to achieve desired behavior) when using the manager in combination with AJAX updates.

    Sincerely yours,
    Tervel
    the Telerik team

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