Event adapter not defined for OnDrawColumnCell

Hello,

I get this error: "Event adapter not defined" when I try code in event OnDrawColumnCell of DBGrid object.
Please, I need help about this.
Thanks.

Hello,

use this:

  DefineEventAdapter(TypeInfo(TDrawColumnCellEvent), TMyDBGridsDispatcher, @TMyDBGridsDispatcher.__TDBGridDrawColumnCell);


type
  TMyDBGridsDispatcher = class(TatEventDispatcher)
  private
    procedure __TDBGridDrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumn; State: TGridDrawState);
  end;

uses ap_Types

procedure TMyDBGridsDispatcher.__TDBGridDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
  StateTempSet: TGridDrawState;
  StateTemp: variant;
  RectW: TRectWrapper;
begin
  if Assigned(Scripter) and (RoutineName > '') then
  begin
    StateTempSet := State;
    StateTemp := IntFromSet(StateTempSet, SizeOf(TGridDrawState));
    RectW := TRectWrapper.Create(Rect);
    Scripter.ExecuteSubroutine(RoutineName, [Sender, RectW,  DataCol, Column, StateTemp]);
    RectW.Free;
  end;
end;

Hello, thanks for you answer,

I see you date of post (wagner landgraf) puts 08 may 2010 (2010?) I think an error.
Please, where change this code of DefineEventAdapter? or TMyDBGridsDispatcher?
Thanks

I believe you are seeing the date I joined the forums? The date of the post is on top of the post, not the left.

You don't need to change any code, you just declare such a class and call DevineEventAdapter procedure as I indicated to register the adapter.