Versuche doch mal folgenden Source einzubinden.
Ist die ONDrawColumnCell-Routine in einem normalen DBGrid, damit
habe ich schon mal ein Grid eingefärbt.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| Procedure TMain_Form.DBG_InhaltLinksDrawColumnCell(Sender: TObject;const Rect:TRect; DataCol:Integer;Column:TColumn;State:TGridDrawState); Begin
Case DAT_Module.TAB_MaterialLinks.FieldByName('M_Farbe').AsInteger of 1 : DBG_InhaltLinks.Canvas.Brush.Color := $000BEFF4; 2 : DBG_InhaltLinks.Canvas.Brush.Color := $0040FF00; 3 : DBG_InhaltLinks.Canvas.Brush.Color := $004848FF; 4 : DBG_InhaltLinks.Canvas.Brush.Color := $00FF80FF; 5 : DBG_InhaltLinks.Canvas.Brush.Color := clAqua; 6 : DBG_InhaltLinks.Canvas.Brush.Color := clSilver; 7 : DBG_InhaltLinks.Canvas.Brush.Color := $008080FF; 8 : DBG_InhaltLinks.Canvas.Brush.Color := $00FD7A77; 9 : DBG_InhaltLinks.Canvas.Brush.Color := $0000A6A6; 10 : DBG_InhaltLinks.Canvas.Brush.Color := $00FFF9F9; End; DBG_InhaltLinks.DefaultDrawColumnCell(Rect, DataCol, Column, State);
End; |
[/delphi]