첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System.Drawing.Drawing2D;
using System.Windows.Forms;

using DevExpress.XtraGrid.Views.Grid;

...

private GridView gridView;

...

this.gridView.CustomDrawRowIndicator += gridView_CustomDrawRowIndicator;

...

private void gridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
{
    Brush     brush     = new LinearGradientBrush(e.Bounds, Color.AliceBlue, Color.DodgerBlue, 90);
    Rectangle rectangle = e.Bounds;

    rectangle.Inflate(-1, -1);

    e.Graphics.FillRectangle(brush, rectangle);

    if(e.Info.ImageIndex > -1)
    {
        int x = rectangle.X + (rectangle.Width  - e.Info.Images.ImageSize.Width ) / 2;
        int y = rectangle.Y + (rectangle.Height - e.Info.Images.ImageSize.Height) / 2;

        e.Graphics.DrawImageUnscaled(e.Info.Images.Images[e.Info.ImageIndex], x, y);
    }

    ControlPaint.DrawBorder3D(e.Graphics, e.Bounds, Border3DStyle.RaisedInner);

    e.Handled = true;
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요