Jump to content

dbgrid column color


jahlxx

Recommended Posts

Hi.

 

How to change the color of a column in dbgrid.

 

I do: grid.columns[3].color := clgreen, but no change.

 

I have defined gridcolumncell too, and this one replaces the clgreen color.

 

I don't know how to do for these 2 things at the same time.

 

Thanks.

Link to comment
Share on other sites

yes.  I'm doing here, but with no success.

 

my code is, by example:

 

  if Odd(Arow) then
    attribs.Color := lib.color_1
  else
    attribs.Color := lib.color_2;

  if (qimp.fieldbyname('status').asstring = 'OK') then begin
      attribs.Color := clgreen;
      attribs.font.Color := clWhite;
      attribs.font.size := (sender as tunidbgrid).font.size;
  end;
  if (qimp.fieldbyname('status').asstring = 'REJECTED') then begin
      attribs.Color := clred;
      attribs.font.Color := clWhite;
      attribs.font.size := (sender as tunidbgrid).font.size;
  end;

  if not (sender as tunidbgrid).columns.items[Column.index].readonly then begin
     (sender as tunidbgrid).columns[Column.index].color := clgreen;
  end;
 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...