Jump to content

dbgrid column color


jahlxx
 Share

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

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.

 Share

×
×
  • Create New...