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

Problem with RadTooltipManager

3 Answers 154 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 29 Jun 2008, 07:17 AM
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

3 Answers, 1 is accepted

Sort by
0
Lance
Top achievements
Rank 1
answered on 29 Jun 2008, 07:25 AM
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

 

0
Lance
Top achievements
Rank 1
answered on 29 Jun 2008, 04:51 PM
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...

0
Tervel
Telerik team
answered on 01 Jul 2008, 07:26 AM
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
Tags
ToolTip
Asked by
Lance
Top achievements
Rank 1
Answers by
Lance
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or