Jump to content


Photo

Change the font and color of the line in dbgrid

mobile dbgrid font color

  • Please log in to reply
3 replies to this topic

#1 AndersonSOS

AndersonSOS

    Member

  • uniGUI Subscriber
  • PipPip
  • 29 posts

Posted 10 October 2017 - 06:37 PM

Hello good afternoon,
I would like to know how to change the font and colors of a dbgrid line at run time.
for example, if any field in the dataset is of a format to change the color of the dbrid.
Best regards
 
Anderson
Manoel Ribas
Brazil

  • 0

#2 Eduardo Belo

Eduardo Belo

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 138 posts
  • LocationBrazil

Posted 10 October 2017 - 07:44 PM

procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject;
  ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
  if UniDBGrid1.DataSource.DataSet['Name'] = 'Brazil' then
  begin
    Attribs.Font.Color := clBlack;
    Attribs.Font.Style := [fsBold];
    Attribs.Color := RGB(255, 231, 147);
  end;
end;

  • 0

#3 AndersonSOS

AndersonSOS

    Member

  • uniGUI Subscriber
  • PipPip
  • 29 posts

Posted 10 October 2017 - 08:00 PM

Hello Eduardo,
Sorry, do not enter the component correctly.
What I am using is the TUniMDbGrid component that is part of the mobile packages but it does not have the DrawColumnCell function.
For web packages I use it that way.
 
I thank you

  • 0

#4 lmacierinha

lmacierinha

    Newbie

  • uniGUI Subscriber
  • Pip
  • 2 posts

Posted 28 March 2018 - 09:47 PM

Anderson

 

Did you succeded solve your problem?

I´m now with the same problem.

 

Luis Claudio

São José do Rio Preto - SP

Brasil


  • 0





Also tagged with one or more of these keywords: mobile, dbgrid, font, color

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users