Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 10.04.05 18:30 
Hi, Delpher,

Ich rufe obige Prozedur auf:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
with TDBGrid(sender) do
begin
  if datacol >= 0 then
  begin
    if gdfocused in state then canvas.brush.color := clred 
    else canvas.brush.color := clwindow;
    canvas.fillrect(rect);
  end;
end;


aber die Daten sind nicht sichtbar! Was mache ich (noch) falsch?

Danke für Hilfe,
Detlef Annies

Moderiert von user profile iconraziel: Delphi-Tags repariert.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 11.04.05 07:43 
Folgende Änderung sollte helfen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
with TDBGrid(sender) do
begin
  if datacol >= 0 then
  begin
    if gdfocused in state then canvas.brush.color := clred 
    else canvas.brush.color := clwindow;
    DefaultDrawColumnCell(Rect, DataCol, Column, State);
//    canvas.fillrect(rect);
  end;
end;

Eine andere Möglichkeit wäre, dass du noch Canvas.TextOut benutzt, um den enthaltenen Text auszugeben.
Oder du machst nur eine farbigen Rahmen (als kein FILLRect, sondern FRAMERect)
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 12.04.05 18:51 
Hi, Peter,

zunächst danke, aber leider wird (weiterhin) nur die markierte Zelle gefärbt, und nicht die Zeile(Datensatz).

Da hänge ich noch immer ... geht wohl nicht ..

Bis Dann, Detlef Annies
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 13.04.05 07:25 
Hast du in den Options des Grids dgRowSelect auf True gesetzt? Falls nicht, solltest du das mal machen.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 13.04.05 14:45 
Hi, Peter!

Ja, das finde ich ja mal wieder soooo cool!

Zwar ist nur die erste Zelle rot und der Rest blau, aber die Zeile (Datensatz) ist markiert!!

Vielen Dank für deinen Tipp,
Detlef Annies