private void gridEX1_FormattingRow(object sender, RowLoadEventArgs e) { GridEXFormatStyle red = new GridEXFormatStyle(); red.BackColor = Color.Red; GridEXFormatStyle white = new GridEXFormatStyle(); white.BackColor = Color.White; //int i = 1; for (int i = 0; i < gridEX1.RowCount; i++) { DateTime theResult; if (DateTime.TryParse(gridEX1.GetRow(i).Cells[9].Value.ToString(), out theResult)) { int compare = DateTime.Compare(theResult, DateTime.Now); if (compare == 0 || compare == -1) gridEX1.RootTable.Columns[12].CellStyle = red; } else gridEX1.RootTable.Columns[12].CellStyle = white; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)