Jump to content

unidbgrid Different colors on the lines


mjcramos

Recommended Posts

I need a help, I'm creating a query screen of titles and I need to differentiate the records with different colors, until then it worked, but when I activate rowselect the selected line becomes transparent, if I had like to paint it of another color, I'm sending an example would be in the DrawColumnCell event

 

procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol,
  ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
//  If gdSelected in State then   //
//    Attribs.Color := clBlue;
  if Column.Field.DataSet.FieldByName('VENCIMENTO').value <  date then
    Attribs.Color := $007085FE
  else if Column.Field.DataSet.FieldByName('VENCIMENTO').value =  date then
    Attribs.Color := $0063FE8A
  else if Column.Field.DataSet.FieldByName('VENCIMENTO').value >  date then
    Attribs.Color := $00FFAC88;
end;

Projeto.rar

Link to comment
Share on other sites

  • 1 year 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...