Recent

Author Topic: Datasource OnDataChange  (Read 834 times)

P.curtis

  • Jr. Member
  • **
  • Posts: 80
Datasource OnDataChange
« on: May 30, 2020, 06:54:37 pm »
Hi All,

Is it possible to make the OnDataChange event only get called on move event (NEXT, FIRST, ....)?

Thanks in advance.

Phil.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Datasource OnDataChange
« Reply #1 on: May 30, 2020, 09:00:42 pm »
Not without a deep change in fcl-db, but you can always ignore any event in your handler. If you only want to react to "scroll" events then do nothing unless: not Assigned(Field)

As the documentation states:
Quote
If the dataset has scrolled, then the Field parameter is Nil
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

P.curtis

  • Jr. Member
  • **
  • Posts: 80
Re: Datasource OnDataChange
« Reply #2 on: May 30, 2020, 09:28:02 pm »
Good call, I'll look into it. Thanks.

 

TinyPortal © 2005-2018