Hola wilcg.
Como creo haberte comentado no he usado el componente
DBGridEh, pero te pongo un ejemplo con un
TDBGrid haciendo el efecto de colores y formato, que creo es el que buscas. Tal vez puedas sacar alguna utilidad del código.
Código Delphi
[-]
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
const
CELCOL: array[Boolean] of TColor = ($00F5F5F5, $00606060);
var
R : TRect;
uFormat: LongWord;
G : TDBGrid;
currFld: string;
begin
G := TDBGrid(Sender);
R := Rect;
uFormat := DT_SINGLELINE or DT_VCENTER or DT_END_ELLIPSIS;
case Column.Alignment of
taLeftJustify : uFormat := uFormat or DT_LEFT;
taRightJustify: uFormat := uFormat or DT_RIGHT;
taCenter : uFormat := uFormat or DT_CENTER;
end;
G.Canvas.Brush.Color := CELCOL[Odd(G.DataSource.DataSet.RecNo)];
G.Canvas.FillRect(Rect);
if gdSelected in State then
begin
G.Canvas.Brush.Color := $00A6E8FF;
G.Canvas.Font.Color := clHotLight;
G.Canvas.Font.Name := 'Tahoma';
G.Canvas.Font.Size := 9;
end;
currFld := Column.Field.AsString;
if Column.Field.DataType in [ftFloat, ftCurrency, ftBCD] then
currFld:= FormatFloat('S/. 0.00', Column.Field.Value);
DrawText(G.Canvas.Handle, PChar(currFld), -1, R, uFormat);
end;
Salida:
Saludos