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

IAppointmentFactory equivalent in RadScheduleView

6 Answers 105 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
XamlmaX2
Top achievements
Rank 1
XamlmaX2 asked on 15 Feb 2011, 03:02 PM
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

6 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 15 Feb 2011, 03:34 PM
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
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.:

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
Pana
Telerik team
answered on 21 Feb 2011, 07:41 AM
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
0
Troy
Top achievements
Rank 1
answered on 26 May 2011, 03:06 PM
This is functionality I desire to have as well.
Tags
ScheduleView
Asked by
XamlmaX2
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
XamlmaX2
Top achievements
Rank 1
Pana
Telerik team
Troy
Top achievements
Rank 1
Share this question
or