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

TooTipZoneId Sample Project EventArgs

1 Answer 78 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Burl
Top achievements
Rank 2
Burl asked on 15 Aug 2008, 04:51 PM
I'm tying to figure out how you appended the appointmentId in the sample live demo project ToolTipZoneId.

I don't see anything in the aspx file related to the argument being passed into this function?

Protected Sub RadToolTipManager2_AjaxUpdate(ByVal sender As Object, ByVal e As ToolTipUpdateEventArgs)  
            Dim aptId As IntegerInteger = Integer.Parse(e.TargetControlID.Split("_"C)(1))  
            Dim apt As Appointment = RadScheduler1.Appointments(aptId)  
            Dim toolTip As AppointmentToolTip = DirectCast(LoadControl("AppointmentToolTip.ascx"), AppointmentToolTip)  
            toolTip.TargetAppointment = apt 
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip)  
        End Sub 

Thanks, Burl

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 19 Aug 2008, 08:12 AM
Hi Burl,
This example uses the way ClientIDs are formed to get the appointmentID. When a control is added to an INamingContainer, the ClientID of the control is formed the following way - "Parent_ClientID" + "_" + "Control_ClientID". Although this approach works, I would recommend that you use the approach, demonstrated in this example, where the appointmentID is passed as an argument to the AjaxUpdate handler:
Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As ObjectByVal e As AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated  
            If e.Appointment.Visible AndAlso Not IsAppointmentRegisteredForTooltip(e.Appointment) Then 
                Dim id As String 
                If e.Appointment.RecurrenceState <> RecurrenceState.Occurrence Then 
                    id = e.Appointment.ID.ToString()  
                Else 
                    id = e.Appointment.RecurrenceParentID.ToString()  
                End If 
 
                RadToolTipManager1.TargetControls.Add(e.Appointment.ClientID, idTrue)  
            End If 
        End Sub 
 

Protected Sub RadToolTipManager1_AjaxUpdate(ByVal sender As ObjectByVal e As ToolTipUpdateEventArgs)  
            Dim aptId As Integer 
            If Not Integer.TryParse(e.Value, aptId) Then 
                Return 
            End If 
 
            Dim apt As Appointment = RadScheduler1.Appointments.FindByID(aptId)  
            Dim toolTip As AppointmentToolTip = CType(LoadControl("AppointmentToolTip.ascx"), AppointmentToolTip)  
            toolTip.TargetAppointment = apt  
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip)  
        End Sub 
 

Regards,
Tsvetie
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Burl
Top achievements
Rank 2
Answers by
Tsvetie
Telerik team
Share this question
or