0

Trying the comprehensive Delphi code by Mihai MATEI CheckBox in a DBGrid with the small addition of a "silent" event handler as

    procedure TForm1.DBGrid1Enter(Sender: TObject);
    begin
      Try
        DBGrid1ColEnter(Sender);
      except
      end;
    end;

preventing access violation in case entering an inactive DBGrid.

The check boxes works fine for one or more successive datasets, but only until I close some dataset while the DBGrid cursor is located on some logical/Boolean column.

For successively opened datasets any keyboard entry is ignored except for the checkbox columns unless relaunching the application.

Could it be related to some handling of the DBGrid.Options getting corrupted when not closing the dataset from a cursor location on a non-Boolean column? Any solutions?

Best Regards

NKnabe
  • 23
  • 4
  • Don't eat all exceptions as it will just hide bugs. – Brian Mar 08 '21 at 21:46
  • The answer you quote is riddled with design errors and potential bugs. Start again. Don't set grid options in a column enter or exit handler. – MartynA Mar 08 '21 at 22:35

0 Answers0