Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer;
- Column: TColumn; State: TGridDrawState);
- var
- Grid: TDBGrid;
- Field: TField;
- begin
- Grid := Sender as TDBGrid;
- Field := Column.Field;
- if Assigned(Field) then
- begin
- if SameText(Field.FieldName, 'Clubs') then
- begin
- if SameText(Field.AsString, 'Yes') then
- Grid.Canvas.Brush.Color := clRed
- else
- Grid.Canvas.Brush.Color := clYellow;
- end
- else
- if SameText(Field.FieldName, 'Netice') then
- begin
- case UpCase(Field.AsString[1]) of
- 'D': Grid.Canvas.Brush.Color := clRed;
- 'L': Grid.Canvas.Brush.Color := clgreen;
- 'W': Grid.Canvas.Brush.Color := clYellow;
- end;
- end;
- end;
- Grid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement