Appointments aren't displaying

4 posts, 0 answers
  1. Julien
    Julien avatar
    236 posts
    Member since:
    Jul 2010

    Posted 10 Dec 2011 Link to this post

    Hi,

    In my business datamodel, I've Some activities, which have several "schedules".

    I need to display on one ScheduleView.

    So I've a RadCombobox bound on my list of Activities, the SelectedItem is bound to property on my code behind, and this "Activity" object is bound to the AppointmentsSource, with a converter, which basically create one Appointment for each schedule:

    public class ActivityToAppointmentConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || !(value is Activity)) return value;
            Activity activity = (Activity) value;
            List<Appointment> appointments = new List<Appointment>();
            foreach (Schedule schedule in activity.Schedules)
            {
                appointments.Add(new Appointment()
                                     {
                                         Subject = schedule.Activity.Name,
                                         Body = schedule.Activity.Informations,
                                         Start = schedule.StartDate,
                                         End = schedule.EndDate,
                                          
                                     });
            }
     
            return appointments;
        }
     
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    (I tried to set all field of the "Appointment" object, but it doesn't work either.

    I but a breakpoint on the "return appointments" line, and I've appointments.

    (I also bound the SelectedTimeSlot on the activity, with a converter which takes the start date of the first schedule and the end date of the last schedule, like this, the radScheduler display directly the good period, this part work like a charm).

    But I don't know why, event if I put a breakpoint(checking the date of the appointment), and checking the same period, I don't see any appointment appearing.

    So:
    -The converter gives good data
    -The binding seems to be right
    -I'm absolutely sure to be on the good period

    So why my appointments aren't appearing?
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Dec 2011 Link to this post

    Hello Julien,

    I created a simple application that demonstrates my understanding of your scenario, but it seems to work fine. Could you please check if I am doing something differently than you?

    Greetings,
    Valeri Hristov
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Julien
    Julien avatar
    236 posts
    Member since:
    Jul 2010

    Posted 13 Dec 2011 Link to this post

    I finally found the difference between your example and my code. I was using the RadScheduler, instead of the RadScheduleView.

    Thank you for the help!

    But what's the difference between those two components??
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 Dec 2011 Link to this post

    Hi Julien,

    RadScheduleView was designed to replace RadScheduler while keeping it features and addressing most of its problems - performance, ease of use and customize, etc. I would strongly recommend not using RadScheduler as it is already obsolete and does not receive new features or bugfixes.

    Kind regards,
    Valeri Hristov
    the Telerik team

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

Back to Top