I got this code from the Inprise web page, but when I run it, I get an access violation. Any ideas why? I am using Delphi v3.0
type
TCustomDBGridCracker = class(TCustomDBGrid);
var
Cracker: TCustomDBGridCracker;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with Cracker(Sender) do
if DataLink.ActiveRecord = Row - 1 then
Canvas.Brush.Color := clRed
else
Canvas.Brush.Color := clWhite;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
It is what you need .
If you send me your address I send you the component and a shot example .
Nick