Ejemplo n.º 1
0
 public CustomGridOptionsCustomization()
     : base()
 {
     this.allowQuickCustomisation = true;
     quickCustomizationIcon = new QuickCustomizationIcon();
 }
Ejemplo n.º 2
0
        protected virtual void DrawQuickCustomisationIconCore(GridViewDrawArgs e, IndicatorObjectInfoArgs info, QuickCustomizationIcon icon, Rectangle bounds, QuickCustomisationIconStatus status)
        {
            Rectangle patchedRec = new Rectangle(bounds.X + 1, bounds.Y, bounds.Width - 1, bounds.Height);
            GridColumnInfoArgs args = new GridColumnInfoArgs(e.Cache, e.ViewInfo.ColumnsInfo[0].Column);
            args.Cache = e.Cache;
            args.Bounds = patchedRec;
            ((HeaderObjectInfoArgs)args).HeaderPosition = HeaderPositionKind.Center;
            if (status == QuickCustomisationIconStatus.Hot)
                ((HeaderObjectInfoArgs)args).State = ObjectState.Hot;
            ElementsPainter.Column.DrawObject(args);

            if (icon.Image != null)
            {
                Rectangle rec = new Rectangle();
                rec.Location = new Point(bounds.Left + 1, bounds.Top + 1);
                rec.Size = new Size(bounds.Width - 2, bounds.Height - 2);
                ImageAttributes attr = new ImageAttributes();
                attr.SetColorKey(icon.TransperentColor, icon.TransperentColor);
                e.Graphics.DrawImage(icon.Image, rec, 0, 0, icon.Image.Width, icon.Image.Height, GraphicsUnit.Pixel, attr);
            }
        }