http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q896q
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q

解决方案 »

  1.   

    DataDrowGridTextBoxColumn Col0 = new DataDrowGridTextBoxColumn();
    Col0.MappingName="HouseCode";
    Col0.HeaderText="合作医疗号";
    Col0.Width=110;
    Col0.SetDrowCellColor += new DrowCellEventHandler(this.SetDGRowLineColor);
    重写控件
    #region DataDrowGridTextBoxColumn
    public class DataDrowGridTextBoxColumn:DataGridTextBoxColumn
    {
    //-----------11-1--
    public event DrowCellEventHandler SetDrowCellColor; 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.SetDrowCellColor!=null)
    {
    DataGridDrowCellEventArgs e = new DataGridDrowCellEventArgs();
    e.Row = rowNum;
    this.SetDrowCellColor(this,e);
    backBrush = e.BackBrush;
    foreBrush = e.ForeBrush;
    //backBrush = new SolidBrush(Color.FromArgb(255, 200, 200));
    }
    base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
    }
    //-----------------
    }
    #endregion
      

  2.   

    事件
    private void SetDGRowLineColor(参数)
    {
    if(...)
    {
    e.ForeBrush = new SolidBrush(Color.Red);
    }
    }QQ 15665964