private void vGridControl1_RecordCellStyle(object sender, DevExpress.XtraVerticalGrid.Events.GetCustomRowCellStyleEventArgs e) { int index; if (radioGroup1.SelectedIndex == 0) { index = e.RecordIndex; } else { index = e.Row.VisibleIndex; } if ((index + 1) % 2 == 0) { e.Appearance.BackColor = Color.SkyBlue; } else { e.Appearance.BackColor = Color.LightPink; } }
private void warrantyGridControl_RecordCellStyle(object sender, DevExpress.XtraVerticalGrid.Events.GetCustomRowCellStyleEventArgs e) { try { if (_JSON_WARRANTY != null) { GridView gView = sender as GridView; if (e.Row.Properties.FieldName == "expireDate") { DateTime expireDate = Convert.ToDateTime(_JSON_WARRANTY.result.expireDate.ToString()); DateTime today = DateTime.Now; if (expireDate > today) { e.Appearance.BackColor = Color.CornflowerBlue; } else { e.Appearance.BackColor = Color.DarkRed; } } } } catch { } }