Weird behavior of TCRDBGrid
Posted: Tue 15 Dec 2009 21:27
Not sure if this is due to TCRDBGrid or BDS in general.
IDE : BDS 2006
MyDAC : v5.55.0.39
Windows : XP + SP3
I have my own frame (say frameWithGrid) with a TCRDBGrid inside it. There is an OnCellClick event (frameWithGridGridCellClick) which toggles a checkbox.
If I drop this frame onto a form (say formHasFrame) as is without overriding the OnCellClick event (ie: no code for formHasFrameGridCellClick event), my check box on the frame will be toggled properly.
However if I write code for formHasFrameGridCellClick() and later remove the code (by emptying the entry in the property explorer), the cell click event is not fired at all, resulting that the OnCellClick event in the ancestor being ignored. Looking at the dfm file I discovered that there is a line 'OnCellClick = nil' for formHasFrame. If I remove this line from dfm, the cell click event is fired properly again (thus running code in the ancestor).
I have not tested other vcl components but I would expect emptying an event from the property explorer would have removed all override event code and fall back onto the ancestors' event code. Is it not?
Could any guru verify this?
IDE : BDS 2006
MyDAC : v5.55.0.39
Windows : XP + SP3
I have my own frame (say frameWithGrid) with a TCRDBGrid inside it. There is an OnCellClick event (frameWithGridGridCellClick) which toggles a checkbox.
If I drop this frame onto a form (say formHasFrame) as is without overriding the OnCellClick event (ie: no code for formHasFrameGridCellClick event), my check box on the frame will be toggled properly.
However if I write code for formHasFrameGridCellClick() and later remove the code (by emptying the entry in the property explorer), the cell click event is not fired at all, resulting that the OnCellClick event in the ancestor being ignored. Looking at the dfm file I discovered that there is a line 'OnCellClick = nil' for formHasFrame. If I remove this line from dfm, the cell click event is fired properly again (thus running code in the ancestor).
I have not tested other vcl components but I would expect emptying an event from the property explorer would have removed all override event code and fall back onto the ancestors' event code. Is it not?
Could any guru verify this?