Subject Re: [IBO] IB_Grid.PreventEditing and the InPlaceEditor
Author Geoff Worboys
> > overriding CanEditModify and/or CanEditShow (from TCustomGrid).
>
> No, this doesn't work. I have overriden both Functions with
> Result:=false, but nothing changes.

Hmmm, thats a pity. Not sure why this would not work, in
VCL\grids.pas...

procedure TCustomGrid.UpdateEdit;
<snip>
begin
if CanEditShow then
begin
<snip>


UpdateEdit is called by ShowEditor and the code seems to imply that
nothing will happen if CanEditShow returns false. Perhaps you could
try a break point in your override to see if it is ever called, or
perhaps a break point in the

VCL\grids.pas
procedure TInplaceEdit.Move(const Loc: TRect);

which should be called whenever the inplace editor is shown. This may
let you discover where the call is coming from that is bypassing the
call to CanEditShow.



> I had another idea, when the dataset is PreventEditing:=true, I
> set the Grid.readOnly:=true, but I haven't found the event, to
> react on changes to the dataset. I tried SysStateChanged, but
> this doesn't work for me. Any ideas

Not sure. Again I thought that overriding YourGrid.SysStateChanged
would do it. See how you go investigating the above suggestion and if
that does not work we will come back to this.


Geoff Worboys
Telesis Computing