Переключение приложения на использование DevExpress XtraGrid и реализация настраиваемого цвета и формата для строк/ячеек.
По большей части форматы применяются правильно. Однако при применении к десятичному числу 1000 в следующем формате "#,###;(#,###);0" получается 1000.0000 вместо 1000.
gridView.RowCellStyle += CellFormatting;
private void CellFormatting(object sender, RowCellStyleEventArgs e)
{
if (gridView.IsRowSelected(e.RowHandle))
{
e.Appearance.BackColor = SystemColors.Highlight;
e.Appearance.ForeColor = SystemColors.HighlightText;
return;
}
// get cell by its index
var gridRow = gridView.GetRow(e.RowHandle);
TLColumn columnEnum = ((BindableTextBoxColumn)e.Column).ColumnEnum;
// get new format values
T row = (T)gridRow;
e.Column.DisplayFormat.FormatString = row.GetCellFormat(columnEnum);
e.Appearance.BackColor = row.GetCellBackColor(columnEnum);
e.Appearance.ForeColor = row.GetCellColor(columnEnum);
}