Autor Beitrag
Morpheus1572
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157

Win XP
Delphi 7
BeitragVerfasst: So 21.12.08 00:21 
Hallo,

wie ich herrausfinde welche zeilen ich im DBGrid markiert habe weiß ich mittlerweile durch die zahlreichen einträge hier. was mir jetzt nicht klar ist, ist der Schritt rückwärts.

Also: wie kann ich aufgrund eines bestimmten DBEintrages eine zeile im Grid markieren bzw. farbig einfärben? das soll nämlich geschehen, wenn in einem feld inhalt existiert...

Thx für den Denkanstoß... Morph.
Morpheus1572 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157

Win XP
Delphi 7
BeitragVerfasst: Mo 22.12.08 12:40 
*push* Sorry, problem besteht noch. ;-)
Morpheus1572 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157

Win XP
Delphi 7
BeitragVerfasst: So 04.01.09 10:59 
Hier die Lösung falls irgendwann jemand anderes auch diese Frage hat...:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  with (Sender as TDBGrid) do
  begin
    //Wenn ein bestimmter Inhalt da ist, dann wird nur diese Zeile gefüllt.
    If DataSource.DataSet.FieldByName('FELDNAME').AsString = '<Feldinhalt>' then
    begin
      Canvas.Brush.Color := $00A0A5FE;
      Canvas.FillRect(Rect);
    end;
    //Denn Text in der Zelle ausgeben
    DefaultDrawDataCell(Rect,Field,State);
  end;