Appointments.FindByID not work with RadToolTipManager OnAjaxUpdate

4 posts, 0 answers
  1. Vikram
    Vikram avatar
    10 posts
    Member since:
    Oct 2010

    Posted 07 Dec 2013 Link to this post

    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?
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 11 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vikram
    Vikram avatar
    10 posts
    Member since:
    Oct 2010

    Posted 12 Dec 2013 Link to this post

    Hello Kate,

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

    Regards,
    Vikram



  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 17 Dec 2013 Link to this post

    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.
Back to Top