Component File /YDataGrid/DataGridColorColumnStyle.cs (C#)
using System;  
using System.Windows.Forms;  
  
namespace YariSoft.Windows.Conrols  
{  
    public delegate void OnDataGridColumnPainEventHandler  
                                      ( ref System.Drawing.Graphics g,  
                                        ref System.Drawing.Rectangle bounds,  
                                        ref System.Windows.Forms.CurrencyManager source,  
                                        ref int rowNum,  
                                        ref System.Drawing.Brush backBrush,  
                                        ref System.Drawing.Brush foreBrush,  
                                        ref bool alignToRight);  
  
    public class YDataGridColorTextBoxColumn : DataGridTextBoxColumn  
    {  
        public event OnDataGridColumnPainEventHandler OnPaint = null;  
  
        protected override void Paint( System.Drawing.Graphics g,  
                                       System.Drawing.Rectangle bounds,  
                                       System.Windows.Forms.CurrencyManager source,  
                                       int rowNum,  
                                       System.Drawing.Brush backBrush,  
                                       System.Drawing.Brush foreBrush,  
                                       bool alignToRight )  
        {  
            if( this.OnPaint != null ){  
                this.OnPaint( ref g, ref bounds, ref source, ref rowNum, ref backBrush, ref foreBrush, ref alignToRight );  
            }  
            base.Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );  
        }  
    }  
  
    public class YDataGridColorBoolBoxColumn : DataGridBoolColumn  
    {  
        public event OnDataGridColumnPainEventHandler OnPaint = null;  
  
        protected override void Paint( System.Drawing.Graphics g,  
                                       System.Drawing.Rectangle bounds,  
                                       System.Windows.Forms.CurrencyManager source,  
                                       int rowNum,  
                                       System.Drawing.Brush backBrush,  
                                       System.Drawing.Brush foreBrush,  
                                       bool alignToRight )  
        {  
            if( this.OnPaint != null ){  
                this.OnPaint( ref g, ref bounds, ref source, ref rowNum, ref backBrush, ref foreBrush, ref alignToRight );  
            }  
            base.Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );  
        }  
    }  
}