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

Appointments.FindByID not work with RadToolTipManager OnAjaxUpdate

3 Answers 69 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Vikram
Top achievements
Rank 1
Vikram asked on 07 Dec 2013, 07:39 AM
I'm trying to show appointments in TimeLineView grouped by resources. For each appointment in RadScheduler, I want to display dynamic tooltip. For that I had used RadToolTipManager and OnAjaxUpdate.

Code Snippet - 

protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
    {
        // THIS WORKS SUCCESSFULLY
        Appointment appointment = null;
        foreach (var apt in EventScheduler.Appointments.Where(apt => apt.ID.ToString().Equals(e.Value)))
        {
            appointment = apt;
            break;
        }
 
        // CODE COMMENTED BELOW NOT WORKS. WHY?
        //int aptId;
        //var appointment = int.TryParse(e.Value, out aptId) ? EventScheduler.Appointments.FindByID(aptId) : EventScheduler.Appointments.FindByID(e.Value);
 
        if (appointment == null) return;
 
        var toolTip = (AppointmentToolTip)LoadControl("UserControl/AppointmentToolTip.ascx");
        toolTip.TargetAppointment = appointment;
        e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
    }

I am seeking answer to why part in code comment.  If it work one way, then it must work another way. Did anyone else noticed this bug?

I believe that the commented part is more optimized and fast in comparison to method I had implemented. So can Telerik team confirm that code I'm using would be equivalent fast?

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 11 Dec 2013, 02:31 PM
Hello Vikram,

Having the information that you provided it should be possible to find any specific appointment with a specified id with the code below:
//where the RadScheduler1 id the ID of the RadScheduler control
  RadScheduler1.Appointments.FindByID("");

However, if the approach that you currently apply works as expected you can also use it as an alternative to get the desired behavior.

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Vikram
Top achievements
Rank 1
answered on 13 Dec 2013, 04:05 AM
Hello Kate,

I agree with you. But you didn't answered why part in code.

Regards,
Vikram



0
Kate
Telerik team
answered on 17 Dec 2013, 09:47 AM
Hi Vikram,

I have been testing the scenario that you described and the code that you provided with this demo and I was not able to get the issue that you get. I tried both your code and the code from the demo and I was able to find the appointment. Let me know if there are any particular steps that I need to follow to get the behavior that you currently experience.

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Scheduler
Asked by
Vikram
Top achievements
Rank 1
Answers by
Kate
Telerik team
Vikram
Top achievements
Rank 1
Share this question
or