void PivotGridControlOnCustomDrawCell(object sender, PivotCustomDrawCellEventArgs e) { var fieldPeriod = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.ColumnFieldName]; if (Equals(e.GetFieldValue(fieldPeriod), CurrentPeriod)) { var fieldMonth = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.RowFieldName]; object month = e.GetFieldValue(fieldMonth); var fieldRevenue = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.DataFieldName]; decimal currentValue = Convert.ToDecimal(e.GetCellValue(fieldRevenue)), compareValue = Convert.ToDecimal(e.GetCellValue(new object[] { ComparePeriod }, month != null ? new[] { e.GetFieldValue(fieldMonth) } : null, fieldRevenue)); if (currentValue > compareValue) { e.Appearance.ForeColor = CommonColors.GetInformationColor(UserLookAndFeel.Default); } else if (currentValue < compareValue) { e.Appearance.ForeColor = CommonColors.GetCriticalColor(UserLookAndFeel.Default); } } }
void UpdateCustomColors() { red = CommonColors.GetCriticalColor(DevExpress.LookAndFeel.UserLookAndFeel.Default); green = CommonColors.GetInformationColor(DevExpress.LookAndFeel.UserLookAndFeel.Default); }