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

using DevExpress.XtraGrid.Views.Grid;

...

private GridView gridView;

...

this.gridView.RowCellStyle += gridView_RowCellStyle;

...

private void gridView_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
    if(e.RowHandle != this.gridView.FocusedRowHandle || e.Column.AbsoluteIndex == this.gridView.FocusedColumn.AbsoluteIndex)
    {
        if(e.Column.FieldName == "Category" && this.gridView.GetRowCellValue(e.RowHandle, e.Column).Equals(6))
        {
            e.Appearance.Font = new Font(AppearanceObject.DefaultFont, FontStyle.Bold);

            e.Appearance.ForeColor = Color.Navy;
        }

        if(e.Column.FieldName == "Unit Price" && this.gridView.GetRowCellValue(e.RowHandle, e.Column) is Decimal)
        {
            if((Decimal)this.gridView.GetRowCellValue(e.RowHandle, e.Column) > 30)
            {
                e.Appearance.BackColor = Color.FromArgb(192, 192, 255);
            }
        }
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요