private void GridView_AttendanceData_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (IsInvalidValue(e.Info.Value))
            {
                int       dx    = e.Bounds.Height;
                Brush     brush = e.Cache.GetGradientBrush(e.Bounds, Color.Wheat, Color.FloralWhite, LinearGradientMode.Vertical);
                Rectangle r     = e.Bounds;
                //Draw a 3D border
                BorderPainter    painter          = BorderHelper.GetPainter(DevExpress.XtraEditors.Controls.BorderStyles.Style3D);
                AppearanceObject borderAppearance = new AppearanceObject(e.Appearance)
                {
                    BorderColor = Color.DarkGray
                };
                painter.DrawObject(new BorderObjectInfoArgs(e.Cache, borderAppearance, r));
                //Fill the inner region of the cell
                r.Inflate(-1, -1);
                e.Cache.FillRectangle(brush, r);
                //Draw a summary value
                r.Inflate(-2, 0);
                e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
                //Prevent default drawing of the cell
                e.Handled = true;

                /*
                 * StringFormat format = new StringFormat();
                 * format.Alignment = StringAlignment.Near;
                 * Rectangle r = e.Bounds;
                 * r.Inflate(-2, 0);
                 * Font f = new System.Drawing.Font("Tahoma", 8.25f, FontStyle.Bold);
                 *
                 * e.Appearance.BackColor = Color.FromArgb(50, 255, 0, 0);
                 * e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r, f, format);
                 */
                /*
                 * e.Appearance.BackColor = Color.FromArgb(50, 255, 0, 0);
                 * e.Appearance.FillRectangle(e.Cache, e.Bounds);
                 * e.Info.AllowDrawBackground = false;
                 */
            }
        }
Ejemplo n.º 2
0
 private void GridView_SalaryProcess_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (IsInvalidValue(e.Info.Value))
     {
         int       dx    = e.Bounds.Height;
         Brush     brush = e.Cache.GetGradientBrush(e.Bounds, Color.Wheat, Color.FloralWhite, LinearGradientMode.Vertical);
         Rectangle r     = e.Bounds;
         //Draw a 3D border
         BorderPainter    painter          = BorderHelper.GetPainter(DevExpress.XtraEditors.Controls.BorderStyles.Style3D);
         AppearanceObject borderAppearance = new AppearanceObject(e.Appearance)
         {
             BorderColor = Color.DarkGray
         };
         painter.DrawObject(new BorderObjectInfoArgs(e.Cache, borderAppearance, r));
         //Fill the inner region of the cell
         r.Inflate(-1, -1);
         e.Cache.FillRectangle(brush, r);
         //Draw a summary value
         r.Inflate(-2, 0);
         e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
         //Prevent default drawing of the cell
         e.Handled = true;
     }
 }