Delphi XE 8 DBGRID

Delphi

13/11/2015

Boa noite pessoal, no meu DBGRID coloquei para aparecer uma imagem caso o resultado fosse -1
e continua aparecendo o -1 e não sei como tirar. Abraço
procedure TfrmCadastroClientes.DBGrid2DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
    if Column.Field.FieldName = 'Principal' then
    Begin
        if Column.Field.Value = '-1' then
        begin
            sAlphaImageList1.Draw(DBGrid2.Canvas, Rect.Left + 24, Rect.Top + 1, 0);
        end;
    End;
end;

[img]http://arquivo.devmedia.com.br/forum/imagem/457742-20151113-200356.jpg[/img]
Luis Dantas

Luis Dantas

Curtidas 0

Melhor post

Rafael Bosco

Rafael Bosco

17/11/2015

Tente tirar o valor antes de colocar a imagem:

        if Column.Field.Value = '-1' then
        begin
            Column.Field.Value = EmptyStr;
            sAlphaImageList1.Draw(DBGrid2.Canvas, Rect.Left + 24, Rect.Top + 1, 0);
        end;
GOSTEI 1

Mais Respostas

Luis Dantas

Luis Dantas

13/11/2015

Consegui.
Obrigado
GOSTEI 0
POSTAR