I'm using timelinewiew with resources (people) to develop a planning application. Purpose is to have "events" not assigned to a resource and by moving the event and dropping it on a resource's timeline assign it to that resource. The setup works fine, display of both events and resources works. The events are actually two classes of business objects that both derive from one class that exposes the Appointment attributes (start, end, subject etc.). Both types of events are supplied from database in generic lists. Resources too.
I have implemented the server-side method myScheduler_AppointmentUpdated with logic to update an event if it is dragged from one resource's timeline to another (and then setting the schedulers DataSource to an updated list of events). This seems to work, as at least sometimes when I move an event from one resource to another, the AppointmentUpdate event is fired. But, the event does not fire every time. I have tried to find a pattern for when the event fires and when not, but it seems random.
Not using any client-side stuff at all.
It seems I'm missing something basic here, which is probably correct as I'm a Telerik/scheduler noob :)
Anyone have any ideas?
Attached a screenshot of the timeline layout.
This is my scheduler:
And this is my code-behind:
ResourceType rt = new ResourceType();
rt.Name = "Resources";
rt.ForeignKeyField = "ResourceId";
rt.KeyField = "Id";
rt.TextField = "FullName";
> blapp = new List<
Entities.Resource r = new Entities.Resource();
r.firstName = "Inte";
r.lastName = "tillsatt";
r.Id = 0;
rt.DataSource = blapp;
DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
schAbsences.SelectedDate = startTime;
schAbsences.TimelineView.GroupBy = "Resources";
schAbsences.TimelineView.GroupingDirection = GroupingDirection.Vertical;
protected void schAbsences_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
String type = e.Appointment.Attributes["appointmentType"];
//Do update (use Attributes)
int origRsId = int.Parse(e.Appointment.Resources.Key.ToString());
int origResId = int.Parse(e.Appointment.Resources.Key.ToString());
int newResId = int.Parse(e.ModifiedAppointment.Resources.Key.ToString());
e.Cancel = true;
> list = DBManager.GetAllAbsencesAsEvents();
schAbsences.DataSource = list;