DBGrid List index (23) out of bounds lazarus / 16-Databases ---------------------------------------------------------------------- universe · 2014-12-02 09:23 Hello all, I have a database programme running fine until I added some code to the OnDrawColumnCell event of a TDBGrid the code is Code: [Select]procedure TfrmMain.dbgItemsDrawColumnCell(Sender: TObject; const Rect: TRect;   DataCol: Integer; Column: TColumn; State: TGridDrawState); begin   if Column.FieldName='designation' then   begin     Column.SizePriority:=0;     Column.Width:=200;   end;   if Column.FieldName='item_no' then   begin     Column.SizePriority:=0;     Column.Width:=150;   end; end; Then the exception List index (23) out of bounds is raised randomly in Code: [Select]CLASSES$_$TFPLIST_$__$$_RAISEINDEXERROR$LONGINT I saw similar forum posts talking about the OnDraw (bug) after calling clear of TChart, but I don't know if this is the same (as it's in TFPList), any suggestion? Thanks in advance for any hint. ---------------------------------------------------------------------- taazz · 2014-12-02 17:34 Create the smallest demo possible and attach it in a message here so we can have a look. ---------------------------------------------------------------------- universe · 2014-12-03 08:02 Ok, I'll prepare it asap. Thanks