Subject Re: [IBO] prevent Rowchange in Grid while state <>dssbrowse
Author Harald Klomann
stahlberger@... wrote:
>
> Hi all,
> any ideas how to "freeze" an IB_grid while query.state <> dssbrowse?
> For up- and downkey i use OnBeforeScroll to lock the Grid to the current
> inserting/editing Row, works fine.
> To prevent from Mousclicks on another Row i have no idea. Do You?
>

This would also be a very easy solution without checking grid events :

procedure TForm1.QueryBeforePost(IB_Dataset: TIB_Dataset);
begin
if (Screen.ActiveControl is TIB_Grid) and not (IB_UpdateBar1.FocusedButton = ubPost) then begin
sysutils.abort;
end
end;

// or InheritsFrom(TIB_Grid), or TDB_Grid
// or your own button for Post actions


Harald