private void gridView1_RowCellStyle(object sender, XtraGrid.Views.Grid.RowCellStyleEventArgs e) { if (e.RowHandle == gridView1.FocusedRowHandle && gridView1.FocusedColumn != e.Column) { e.Appearance.BackColor = gridView1.PaintAppearance.FocusedRow.BackColor; e.Appearance.ForeColor = gridView1.PaintAppearance.FocusedRow.ForeColor; } }
private void gridView1_RowCellStyle(object sender, XtraGrid.Views.Grid.RowCellStyleEventArgs e) { if (e.Column.Caption == "订单状态") { if (e.CellValue.ToString() == "正常") { e.Appearance.BackColor = Color.Green; } else { e.Appearance.BackColor = Color.Red; } } }
void gvEvaluations_RowCellStyle(object sender, XtraGrid.Views.Grid.RowCellStyleEventArgs e) { Evaluation evaluation = gvEvaluations.GetRow(e.RowHandle) as Evaluation; if (evaluation == null) { return; } if (evaluation.Rating == EvaluationRating.Good) { e.Appearance.ForeColor = ColorHelper.InformationColor; } if (evaluation.Rating == EvaluationRating.Poor) { e.Appearance.ForeColor = ColorHelper.CriticalColor; } }