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

Appointments aren't displaying

3 Answers 46 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 10 Dec 2011, 02:38 PM
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?

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 13 Dec 2011, 10:30 AM
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 >>

0
Julien
Top achievements
Rank 1
answered on 13 Dec 2011, 08:47 PM
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??
0
Valeri Hristov
Telerik team
answered on 14 Dec 2011, 02:55 PM
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 >>

Tags
ScheduleView
Asked by
Julien
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Julien
Top achievements
Rank 1
Share this question
or