[Lazarus-es] dbgrid; ondrawcolumncell

Paola Bruccoleri pbruccoleri en adinet.com.uy
Mie Abr 20 02:04:24 CEST 2011


El 19/04/2011 02:43 p.m., Ismael L. Donis García escribió:

Hola Ismael..
si ponés un showmessage donde te indico, y que debe devolver S, N o 
nada, siempre devuelve nada (tengo 2 registros en la consulta, uno que 
tiene S y otro ' ') por eso es que no cmbia nada, porque no entra en 
ningún if (ya lo depuré)

>
> procedure Tform.dbgDrawColumnCell(Sender: TObject; const Rect: TRect;
>   DataCol: Integer; Column: TColumn; State: TGridDrawState);
>
> begin
showmessage(qry.FieldByName('adjudicada').Value)
>   with Sender as TDBGrid do
>     begin
>       if qry.FieldByName('adjudicada').Value = 'S' then  // verde
>              Canvas.Brush.Color:= clMoneyGreen
>       else if qry.FieldByName('adjudicada').Value = 'N' then  // rojo
>              Canvas.Brush.Color:= $00EEEEFF
>       else  // amarillo
>              Canvas.Brush.Color:= RGB(254,253,192);
>       DefaultDrawColumnCell (Rect,DataCol,Column,State);
>     end;
> end;
>
> Para mi que no te cogía ninguno de los 3 valores por los que 
> preguntabas, por lo que al final puse ELSE





More information about the Lazarus-es mailing list