Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
9364
Delayed firing of events
posted

 As a user is cursoring down the grid, other controls need to respond by refetching some data for the record the cursor is on.

Since this data fetch can be time-consuming, I would like the grid event to be fired only when the user rests on record for a certain amount of time (say 500ms). That way if the user is trying to cursor down rapidly, I do not end up doing wasteful data fetches and slow the user down.

Any way to delay the grid event firing? Other suggestions?

Thanks!

 

Parents
No Data
Reply
  • 469350
    Offline posted

    You can't delay the firing of events. But what I would do is use a timer.

    Rather than updating your other controls inside the events of the grid, all the grid events would is start the timer. So let's say you are using AfterRowActivate in the grid. This event would check to see if the timer is already running. If not, it starts the timer. If it is already running, it would stop the timer and re-start it. 

    When the timer Tick event fires, you stop the timer and update your controls.

Children