protected void ASPxPivotGrid1_CustomCellStyle(object sender, DevExpress.Web.ASPxPivotGrid.PivotCustomCellStyleEventArgs e) { if (hfDataSourceType.Value == "column") { if (e.ColumnIndex == this.SelectedColumnIndex) { e.CellStyle.BackColor = Color.Yellow; } } else if (hfDataSourceType.Value == "row") { if (e.RowIndex == this.SelectedRowIndex) { e.CellStyle.BackColor = Color.Yellow; } } if (e.RowIndex == this.SelectedRowIndex && e.ColumnIndex == this.SelectedColumnIndex) { e.CellStyle.BackColor = Color.Red; } }
protected void ASPxPivotGrid1_CustomCellStyle(object sender, DevExpress.Web.ASPxPivotGrid.PivotCustomCellStyleEventArgs e) { if (!cbApplyCustomCellAppearance.Checked) { return; } if (e.RowIndex % 2 == 0) { return; } if (e.ColumnValueType == PivotGridValueType.Value && e.RowValueType == PivotGridValueType.Value) { e.CellStyle.BackColor = Color.FromArgb(240, 240, 240); } if (e.ColumnValueType == PivotGridValueType.Total || e.RowValueType == PivotGridValueType.Total) { e.CellStyle.BackColor = Color.FromArgb(213, 227, 230); } if (e.ColumnValueType == PivotGridValueType.GrandTotal || e.RowValueType == PivotGridValueType.GrandTotal) { e.CellStyle.BackColor = Color.FromArgb(187, 211, 215); } }
protected void gvDashboard_CustomCellStyle(object sender, DevExpress.Web.ASPxPivotGrid.PivotCustomCellStyleEventArgs e) { if (e.ColumnValueType != PivotGridValueType.Value || e.RowValueType != PivotGridValueType.Value) { return; } switch (e.DataField.FieldName) { case "CPU": if (Convert.ToInt32(e.Value) > 80 && Convert.ToInt32(e.Value) <= 90) { e.CellStyle.BackColor = Color.FromName("#FFFFA3"); e.CellStyle.Font.Bold = true; } else if (Convert.ToInt32(e.Value) > 90) { e.CellStyle.BackColor = Color.FromName("#FFBCBC"); e.CellStyle.Font.Bold = true; } break; case "HardDisk": if (Convert.ToInt32(e.Value) > 80 && Convert.ToInt32(e.Value) <= 90) { e.CellStyle.BackColor = Color.FromName("#FFFFA3"); e.CellStyle.Font.Bold = true; } else if (Convert.ToInt32(e.Value) > 90) { e.CellStyle.BackColor = Color.FromName("#FFBCBC"); e.CellStyle.Font.Bold = true; } break; case "Memory": if (Convert.ToInt32(e.Value) > 80 && Convert.ToInt32(e.Value) <= 90) { e.CellStyle.BackColor = Color.FromName("#FFFFA3"); e.CellStyle.Font.Bold = true; } else if (Convert.ToInt32(e.Value) > 90) { e.CellStyle.BackColor = Color.FromName("#FFBCBC"); e.CellStyle.Font.Bold = true; } break; } /* * if (Convert.ToInt32(e.Value) > 90 && * (e.DataField.FieldName == "CPU") || * (e.DataField.FieldName == "HardDisk") || * (e.DataField.FieldName == "Memory") * ) * { * e.CellStyle.BackColor = Color.FromName("#FFBCBC"); * e.CellStyle.Font.Bold = true; * } * else if (Convert.ToInt32(e.Value) > 80 && Convert.ToInt32(e.Value) <= 90 && * (e.DataField.FieldName == "CPU") || * (e.DataField.FieldName == "HardDisk") || * (e.DataField.FieldName == "Memory") * ) * { * e.CellStyle.BackColor = Color.FromName("#FFFFA3"); * e.CellStyle.Font.Bold = true; * } */ }