private void schedulerControl1_SelectionChanged(object sender, System.EventArgs e) { if (mySpaBooking != null) { if (schedulerControl1.SelectedAppointments.Count == 1) { DevExpress.XtraScheduler.Appointment appointment = schedulerControl1.SelectedAppointments[0]; DataRowView rowView = (DataRowView)appointment.GetRow(schedulerControl1.Storage); //fire Event if (mySchedulerChangedEvent != null) { mySchedulerChangedEvent(rowView.Row); } } else { if (mySchedulerChangedEvent != null) { mySchedulerChangedEvent(null); } } } else { if (mySchedulerChangedEvent != null) { mySchedulerChangedEvent(null); } } }
private void toolTipController1_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e) { if (e.SelectedObject is DevExpress.XtraScheduler.Appointment) { DevExpress.XtraScheduler.Appointment appointment = (DevExpress.XtraScheduler.Appointment)e.SelectedObject; if (appointment != null) { DataRowView rowView = (DataRowView)appointment.GetRow(schedulerControl1.Storage); if (rowView != null) { e.Title = rowView["strServiceCode"].ToString() + " " + rowView["strMemberName"].ToString(); e.ToolTip = "Tel No: " + rowView["strMobileNo"].ToString() + " \n Remark: " + rowView["strRemarks"].ToString(); } } } }
private void schedulerControl1_CustomDrawAppointmentBackground(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e) { DevExpress.XtraScheduler.Drawing.AppointmentViewInfo aptViewInfo = e.ObjectInfo as AppointmentViewInfo; if (aptViewInfo != null) { AppearanceObject app = aptViewInfo.Appearance; DevExpress.XtraScheduler.Appointment appointment = aptViewInfo.Appointment; DataRowView rowView = (DataRowView)appointment.GetRow(schedulerControl1.Storage); if (rowView != null) { DataRow row = rowView.Row; if (ACMS.Convert.ToInt32(row["nStatusID"]) == 2) { app.BackColor = Color.Aqua; app.DrawBackground(e.Cache, e.Bounds); } else if (ACMS.Convert.ToInt32(row["nStatusID"]) == 5) { app.BackColor = Color.Yellow; app.DrawBackground(e.Cache, e.Bounds); } if (ACMS.Convert.ToInt32(row["nStatusID"]) == 2 || ACMS.Convert.ToInt32(row["nStatusID"]) == 5) { // // // DevExpress.Utils.AppearanceObject app2 = new DevExpress.Utils.AppearanceObject(); // Rectangle rect1 = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); // // System.Drawing.StringFormat strFormat = new StringFormat(); // strFormat.Alignment = StringAlignment.Near; // // app2.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top; // app2.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; // // System.Drawing.FontStyle fs = new FontStyle(); // fs |= FontStyle.Bold; // fs |= FontStyle.Underline; // // app2.Font = new Font(app2.Font.FontFamily, app2.Font.Size, fs); // app2.DrawString(e.Cache, // "M'ID:" + row["strMembershipID"].ToString() + ", S'Code: " + aptViewInfo.DisplayText, // rect1, strFormat); // // app.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; // app.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; // // Rectangle rect2 = new Rectangle(e.Bounds.X, e.Bounds.Y + 5, e.Bounds.Width, e.Bounds.Height + 5); // // app.DrawString(e.Cache, aptViewInfo.DisplayDescription, rect2, app.TextOptions.GetStringFormat()); // // e.Handled = true; } } } }