I'm still conflicted about how to load the advanced form and prepopulate custom controls on an existing appointment.
Currently my GetAppointments method will return a collection of Telerik Appointments which the scheduler can easily understand and render.
When I go to edit an existing appointment, I need to bind data to custom controls that the appointment class does not have.
I'm still not certain how this is acheived.
I've toyed with creating my own appointment class that derives from the telerik one but the web service provider method I am using will only allow implementing methods that use the telerik appointment.
The thing that I am missing is what happens when a user clicks on the existing appointment.
Where does my custom data will come from?
I have the ID of my appointment in the telrik appointment object. Am I to make a DB call to get the extra info?
Here's an example of my provider.Get method. This method returns the appointments to the scheduler.
List<Appointment> appointmentsList = new List<Appointment>(); |
List<MySpecificAppointment> appts = new List<MySpecificAppointment>(); |
using (AppointmentFacade af = new AppointmentFacade()) |
{ |
appts = ocsf.GetSecureAppointments(HttpContext.Current.User.Identity.Name); //gets appts for user |
} |
foreach (var apt in appts) |
{ |
Telerik.Web.UI.Appointment appointment = new Appointment(); |
appointment.Start = apt.Start; |
appointment.End = apt.End; |
appointment.Description = apt.Description; |
appointment.Subject = apt.Subject; |
appointment.RecurrenceState = apt.RecurrenceState; |
appointment.RecurrenceRule = apt.RecurrenceDescription; |
appointment.RecurrenceParentID = apt.RecurrenceParentID; |
appointment.ID = apt.Id; |
appointmentsList.Add(appointment); |
} |
I can fill the telrik appointment with common objects but anything specififc to MySpecififcAppointment is lost. When a user goes to edit the existing appointment, when the advanced form is loaded only Telerik.Appointment properties will be properly prepopulated.
Any help would be fantastic. Cheers.