protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) { if (!ASPxCallbackPanel1.IsCallback) { return; } string[] parameters = e.Parameter.Split(';'); if (parameters.Length < 1) { return; } string commandName = parameters[0]; if (commandName == "DeleteAppointmentCommand") { int value = Convert.ToInt32(parameters[1]); ASPxScheduler1.Storage.Appointments.Remove(ASPxScheduler1.Storage.Appointments.GetAppointmentById(value)); ASPxScheduler1.DataBind(); AgendaViewControl1.ReloadData(); } else if (commandName == "SwitchViewToAgendaView") { DateTime selectedIntervalStart = ASPxScheduler1.ActiveView.GetVisibleIntervals().Start; DateTime intervalStart = new DateTime(selectedIntervalStart.Year, selectedIntervalStart.Month, 1); AgendaViewControl1.SelectedInterval = new TimeInterval(intervalStart, intervalStart.AddMonths(1)); } }
protected void ASPxScheduler1_AfterExecuteCallbackCommand(object sender, SchedulerCallbackCommandEventArgs e) { if (e.CommandId == SchedulerCallbackCommandId.AppointmentSave) { if (AgendaViewControl1.Active) { ASPxScheduler1.JSProperties["cpAppointmentSaved"] = true; ASPxScheduler1.DataBind(); AgendaViewControl1.ReloadData(); } } }