Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Frage zu DrawColumnCell (https://www.delphipraxis.net/11613-frage-zu-drawcolumncell.html)

schniede 10. Nov 2003 15:53


Frage zu DrawColumnCell
 
Hallo!

ich möchte in einem Grid verschiedene zellen einfärben.

z.B.

Delphi-Quellcode:
 if Column.FieldName = 'Nachfragedatum' then Begin
    if (Column.Field.asstring = copy(aktuelldatum,2,6)+'20'+copy(aktuelldatum,8,2) ) then
    begin
      DBGrid1.Canvas.Brush.Color :=11796479;
      DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
      DBGrid1.Canvas.Brush.Color := holdColor;
    end;
das klapt auch super, wenn ich das Feld einfärbe wo ich auch die Abfrage habe, wie aber kann ich die Abfrage schreiben wenn ich nicht das Feld 'Nachfragedatum' sondern dem Datensatz zugehörigen Namen
Code:
Column.FieldName = 'Name'
einfärben möchte,wie gesagt durch die bedingung datum im feld 'Nachfragedatum' xx.xx.xxxx .

Hoffe das ist verständlich so .

mfg schniede

Garby 10. Nov 2003 16:13

Re: Frage zu DrawColumnCell
 
Hallo,

wenn ich das jetzt richtig verstanden habe müsste das so funktionieren:
Delphi-Quellcode:
  if Column.FieldName = 'Name' then Begin
    if (Column.Field.DataSet.FieldByName('Nachfragedatum').AsString = copy(aktuelldatum,2,6)+'20'+copy(aktuelldatum,8,2) ) then

schniede 10. Nov 2003 16:25

Re: Frage zu DrawColumnCell
 
Ich Danke Dir genaus meinte ich es.

Funzt DAnke :roll:

mfg schniede


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:02 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz