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:
(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?
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 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?