在init时添加
ucGridView1.RowStyle += ucGridView1_RowStyle;
#region
private void ucGridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
GridView View = sender as GridView;
if (e.RowHandle >= 0)
{
object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["FREQUENCY"]);
if (needAlert != null && needAlert.ToString().Trim().Contains("持续"))
{
e.Appearance.ForeColor = Color.BlueViolet;
e.Appearance.BackColor = Color.LightGray;
}
}
}
#endregion