Re: DBGrid1.OnDrawColumnCell goes into infinite loop



> The drawing of the active column Checkbox going into
> infinite loop and causes the screen to freeze. There is
> no code in OnColumnMoved method.

I can't see where, but obviously the OnDrawColumnCell is being called
by something _in_ its code, via some other external code. So unhitch
whatever is calling the OnDrawColumnCell while _your code_ in it is
executing.

At the beginning of your OnDrawColumnCell code do ...

DBGrid1.OnDrawColumnCell := nil;

.... and at the end do ...

DBGrid1.OnDrawColumnCell := DBGrid1DrawColumnCell;

Then the ODCC code will not be called by external events while the ODCC
code is working.

This is a general solution to recursion problems in OnDraw control
event handlers.

Alan Lloyd

.