Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Problem setting resources

Not answered Problem setting resources

Feed from this thread
  • Gustavo avatar

    Posted on Nov 4, 2011 (permalink)

    Hi all,

    We are testing the scheduler control to incorporate it in one of our projects but we are having a problem similar to the one posted in the thread below. 

    http://www.telerik.com/community/forums/wpf/scheduler/how-to-set-resource-as-selected-in-combobox.aspx

    When we load the appointment information, the drop-down of the resource is not set to the correct value. For example, we have an operatory resource that the user assigns in the appointment. We are able to set that and save in the database but when we open the appointment detail the resource is not set. 

    We tried the solution presented by peter in the thread above but it does not apply to our case because we use the Telerik Appointment class. I am putting the code we are using below. Any ideas?

    Thanks


    public override System.Collections.Generic.IEnumerable<Appointment>
                  GetAppointments(RadScheduler owner)
            {
                var events = _messageService.GetEvents();
                IEnumerable<Appointment> appts = events != null ? Mapper.Map<IList<EventDTO>, IEnumerable<Appointment>>(events) : new List<Appointment>();
                int index = 0;
                appts.ToList().ForEach(delegate(Appointment appt) {
                    appt.Owner = owner;
                    appt.RecurrenceState =
                        appt.RecurrenceParentID != null ?
                            RecurrenceState.Exception :
                            !string.IsNullOrEmpty(appt.RecurrenceRule) ?
                                RecurrenceState.Master : 
                                RecurrenceState.NotRecurring;
                    LoadResources(owner, appt, events[index]);
                    index++;
                });
                return appts;
            }
     
    private void LoadResources(RadScheduler owner, Appointment appt, EventDTO eventDTO)
            {
                if (eventDTO.Professional.HasValue)
                {
                    Resource professional = GetResourcesByType(owner, "Professional").FirstOrDefault(r => Convert.ToInt64(r.Key) == eventDTO.Professional);
                    if (professional != null)
                        appt.Resources.Add(professional);
                }
                if (eventDTO.Operatory.HasValue)
                {
                    Resource operatory = GetResourcesByType(owner, "Operatory").FirstOrDefault(r => Convert.ToInt64(r.Key) == eventDTO.Operatory);
                    if (operatory != null)
                        appt.Resources.Add(operatory);
                }
            }

    Reply

  • Yana Yana admin's avatar

    Posted on Nov 4, 2011 (permalink)

    Hi Gustavo,

    We strongly recommend using RadScheduleView, especially for new development - it has better performance and provides more features. You can check its demos and documentation.

    Also note that RadScheduler is marked obsolete and currently receives only minor bug fixes. I suggest to check this blog post for more details about this.

    Kind regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Problem setting resources
Related resources for "Problem setting resources"

WPF Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]