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

Tooltip doesn't display after scheduler navigation

7 Answers 99 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 12 Jun 2008, 09:20 AM
Hi all

I have a scheduler with tooltips which are displayed by clicking a button in an event. All fine there on the current day.

When I navigate to a different date and click the tooltip button in an event nothing happens. An ajax request is made and the scheduler refreshes, the tooltip never displays.

Any ideas what this could be?

Thanks
Jon

7 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 13 Jun 2008, 02:53 PM
Hi Jonathan,

In order to be able to help I need to examine your code and the way you show the tooltips. For the time being I can only assume that the problem is in the RadToolTipManager's TargetControls collection and its content.

Would you please open a new support ticket and send a sample, fully runnable project (including DB if needed)? Once I receive it I will do my best to help. 

All the best,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jonathan
Top achievements
Rank 1
answered on 15 Jun 2008, 09:11 PM
Hi Svetlina

It's a fairly large project so I can't easily send you the project. I'll try to show all the relevant code below and hopefully we can sort it out.

In the AppointmentCreated event I run this code to add the tooltips to the collection.

If (e.Appointment.Visible AndAlso Not IsAppointmentRegisteredForTooltip(e.Appointment)) Then
Dim tttc As New ToolTipTargetControl
Dim linkButton As LinkButton = DirectCast(e.Container.FindControl("LinkButtonMoreInfo"), LinkButton)

tttc.Value =
CInt(e.Appointment.ClientID.Split("_")(1))
tttc.IsClientID =
True
tttc.TargetControlID = linkButton.ClientID
RadToolTipManager1.TargetControls.Add(tttc)
End If

I also have these two events being handled

Protected

Sub RadToolTipManager1_AjaxUpdate(ByVal sender As Object, ByVal e As ToolTipUpdateEventArgs)

Try
If (Scheduler.Appointments.Count > 0) Then
Dim apt As Appointment = Scheduler.Appointments(e.Value)
Dim toolTip As AppointmentToolTip = CType(LoadControl("AppointmentToolTip.ascx"), AppointmentToolTip)
toolTip.TargetAppointment = apt
e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip)
End If
Catch ex As Exception
Throw New Exception(String.Format("Problem with RadToolTipManager1_AjaxUpdate: {0} e.value={1}", ex.Message, e.Value), ex)
End Try
End Sub

Private Sub Scheduler_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Scheduler.DataBound

Try
RadToolTipManager1.TargetControls.Clear()
Catch ex As Exception
Throw New Exception("Problem with Scheduler_DataBound", ex)
End Try
End Sub

In the html of the appointmenttemplate for the scheduler I have this

<

asp:LinkButton ID="LinkButtonMoreInfo" OnClientClick="onButtonClick(this, event);" runat="server" Text="more">
</asp:LinkButton>

Which runs this bit of javascript

function

onButtonClick(sender,e){
//Prevent click bubbling up to scheduler
$telerik.cancelRawEvent(e);
}

And here is the tooltipmanager

<

telerik:RadToolTipManager ManualClose="true" runat="server" ID="RadToolTipManager1"
Width="300" Height="250" RelativeTo="Element" Animation="Resize"
Position="Center"
Sticky="true" Text="Loading..." OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"
ShowEvent="OnClick" />

I hope that all makes sense :)

Thanks
Jon



0
Svetlina Anati
Telerik team
answered on 17 Jun 2008, 09:15 AM
Hello Jonathan,

I modified our online example which demonstrates the integration of RadToolTip and RadScheduler (you can find it here) in order to use the provided by you code.

I tested it and it worked as expected. Then i was able to reproduce the described problem by removing the RadToolTipManager from the update panel - in this case tooltips were shown only for the current day because the RadToolTipManager and its TargetControls collection did not get updated.

If this is your case, please make sure that you update the RadToolTipManager when needed (no matter what you are using - update panel or RadAjaxManager).

If this is not the problem, please create a simple example which replicates your project - I do not need the whole project, just the code which adds and shows tooltips along with your scheduler and DB. 


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jonathan
Top achievements
Rank 1
answered on 17 Jun 2008, 09:56 AM
Hi Svetlina

Previously I had the tooltipmanager in the same update panel as the scheduler and the tooltips displayed for today.

I've just put the tooltipmanager in to it's own update panel and the tooltips disappear right away.

Should the tooltip manager be in the same update panel as the scheduler?

Thanks
Jon
0
Jonathan
Top achievements
Rank 1
answered on 17 Jun 2008, 10:03 AM
Hi Svetlina

I've fixed the problem by taking the scheduler and the tooltipmanager out of update panels and making the ajaxmanager handle the callbacks. This seems to work which is cool.

Thanks for your help.

Jon
0
Accepted
Svetlina Anati
Telerik team
answered on 17 Jun 2008, 11:24 AM
Hi Jonathan,

I am glad you solved the problem.
It does not matter whether the both controls are in the same update panel or not - the important thing is to update both of the controls at the same time.

I suppose that in your previous setup the update panel which held the RadToolTipManager did not get updated when the scheduler was updated. If this is the case, you can make it work by ensuring that when the first update panel gets updated, the second one is also updated.

Let's assume for example that your RadToolTipManager is in an Update Panel with ID UpdatePanel2 and you have the scenario from the discussed online example. In this case you should add the following code line in the code behind handlers for the NavigationComplete and AppointmentInserted events:

UpdatePanel2.Update() 



Kind regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jonathan
Top achievements
Rank 1
answered on 17 Jun 2008, 11:25 AM
Hi Svetlina

I shall keep this in mind in the future :)

Thanks
Tags
ToolTip
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or