private void DrawAutoFilterRowText(GridView view, GraphicsCache cache, Rectangle r)
        {
            AppearanceObject appearance = view.PaintAppearance.TopNewRow;

            appearance.DrawBackground(cache, r);
            appearance.DrawString(cache, _AutoFilterText, r);
        }
예제 #2
0
        private void schedulerControl1_CustomDrawResourceHeader(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
        {
            DevExpress.XtraScheduler.Drawing.ResourceHeader resourceHeader = e.ObjectInfo as ResourceHeader;

            if (resourceHeader != null)
            {
                DataRowView rowView = (DataRowView)resourceHeader.Resource.GetRow(schedulerControl1.Storage);
                if (rowView != null)
                {
                    string dtstartTime = ACMS.Convert.ToDateTime(rowView["dtStartTime"]).ToString("T");
                    string dtEndTime   = ACMS.Convert.ToDateTime(rowView["dtEndTime"]).ToString("T");

                    string           strCaption = resourceHeader.Resource.Caption + "\n" + dtstartTime + " -- " + dtEndTime;
                    AppearanceObject appObj     = resourceHeader.Appearance.Selection;
                    appObj.Font = new Font(appObj.Font.FontFamily.Name, 7);
                    appObj.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                    appObj.BackColor = Color.White;
                    appObj.DrawBackground(e.Graphics, e.Cache, e.Bounds, false);
                    appObj.DrawString(e.Cache, strCaption, e.Bounds);

                    e.Handled = true;
                }
            }
        }
예제 #3
0
        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;
                    }
                }
            }
        }