Jump to content

Recommended Posts

Posted

Quando eu altero o tamanho da  fonte de letra do título de uma coluna no dbgrid, eu recebo a mensagem de erro "Cannot call method 'setStyle' of undefined", conforme imagem em anexo.

 

Alguém também já passou por isso ?

 

 

post-1343-0-87497600-1384442180_thumb.jpg

Posted

Deve ser feito no evento DrawColumnCel.

Segue exemplo abaixo

procedure TfrmGridInsereAltera.UniDBGrid1DrawColumnCell(Sender: TObject; ACol,
  ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
 Column.Title.Font.Size := 10;
 Column.Title.Font.Color := clBlue;
 Column.Title.Font.Style:=[fsBold];
 if ACol=0 then
  begin
    Attribs.Color:=clLtGray;
    Attribs.Font.Style:=[fsBold];

   Column.Title.Font.Size := 9;
   Column.Title.Font.Color := clRed;
   Column.Title.Font.Style:=[fsBold];

  end;
end;
 

Espero que resolva.

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...