Is there an equivalent to IAppointmentFactory (from RadScheduler) in the RadScheduleView?
My AppointmentSource is an ObservableCollection<Appointment>() and contains 2 difference types of appointments (inheriting from Appointment).
I want to be able to control which type is used when creating a new appointment instead of just the baseclass Appointment.
Thanks
My AppointmentSource is an ObservableCollection<Appointment>() and contains 2 difference types of appointments (inheriting from Appointment).
I want to be able to control which type is used when creating a new appointment instead of just the baseclass Appointment.
Thanks
6 Answers, 1 is accepted
0
There is no such equivalent. We use a standard CollectionView for the data operations (Add, Edit, Remove, Group, Filter, etc.) and it only supports automatic item creation. In other words, the CollectionView creates its items (the appointments) and this behavior cannot be overriden in Silverlight.
If you provide more information about your scenario, we could try to suggest something to resolve the problem.
Kind regards,
Valeri Hristov
the Telerik team
If you provide more information about your scenario, we could try to suggest something to resolve the problem.
Kind regards,
Valeri Hristov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0

XamlmaX2
Top achievements
Rank 1
answered on 15 Feb 2011, 04:31 PM
I have two classes based upon Appointment, e.g.:
pseudocode:
ObservableCollection<Appointment> _appointmentSource = new ObservableCollection<Appointment>();
_appointmentSource.Add( new AppointmentType1());
_appointmentSource.Add( new AppointmentType2());
RadScheduleView.AppointmentSource = _appointmentSource;
When RadSchedulerCommands.CreateAppointment is called I want to create an AppointmentType1, not an Appointment (which does not have CustomField1 and CustomField2).
When the appointment dialog shows for editing AppointmentType1 it should have CustomField1 and CustomField2, when the dialog shows for AppointmentType2 it should have CustomerFieldA and CustomFieldB instead (at the moment I'm hacking this with a visibility converter on the controls).
public class AppointmentType1 : Appointment
{
public string CustomField1 { get; set; }
public string CustomField2 { get; set; }
}
public class AppointmentType2 : Appointment
{
public string CustomFieldA { get; set; }
public string CustomFieldB { get; set; }
}
pseudocode:
ObservableCollection<Appointment> _appointmentSource = new ObservableCollection<Appointment>();
_appointmentSource.Add( new AppointmentType1());
_appointmentSource.Add( new AppointmentType2());
RadScheduleView.AppointmentSource = _appointmentSource;
When RadSchedulerCommands.CreateAppointment is called I want to create an AppointmentType1, not an Appointment (which does not have CustomField1 and CustomField2).
When the appointment dialog shows for editing AppointmentType1 it should have CustomField1 and CustomField2, when the dialog shows for AppointmentType2 it should have CustomerFieldA and CustomFieldB instead (at the moment I'm hacking this with a visibility converter on the controls).
0

XamlmaX2
Top achievements
Rank 1
answered on 15 Feb 2011, 06:12 PM
Update: I've worked around this using a wrapper appointment that
contains an instance of either AppointmentType1 or AppointmentType2. In
the constructor I initialize AppointmentType1.
0

XamlmaX2
Top achievements
Rank 1
answered on 16 Feb 2011, 06:21 PM
I really need to be able to create different types of appointment on my ScheduleView by dragging them on, but at the moment this is not possible with the default constructor being called.
0
Hello XamlmaX,
We will consider this limitation and try to provide a feasible solution. However I can not give you an estimate at the moment.
Greetings,
Pana
the Telerik team
We will consider this limitation and try to provide a feasible solution. However I can not give you an estimate at the moment.
Greetings,
Pana
the Telerik team
0

Troy
Top achievements
Rank 1
answered on 26 May 2011, 03:06 PM
This is functionality I desire to have as well.