Grid Control Events

This section discusses the events that runtime fires while processing a grid control.

Depending on the type and mode of the form, runtime fires a variety of events in response to events regarding the grid control.

If you set up a custom fetch routine, you will want to make use of Get Custom Grid Row. To perform a custom fetch, attach logic to this event to fetch a single row. To indicate that there are more records to fetch, use the system function, Continue Custom Data Fetch (set it to True).

When runtime loads the grid control, it fires Add Last Entry Row to Grid when (and if) it adds an entry row as the last line in the grid.

The pattern for adding and updating records is to fire an event immediately before and after commit. Then, runtime fires another event after all the records have been processed. This is a list of applicable events:

  • Add Grid Rec to DB - Before

  • Add Grid Rec to DB - After

  • All Grid Recs Added to DB

  • Update Grid Rec to DB - Before

  • Update Grid Rec to DB - After

  • All Grid Recs Updated to DB

The pattern for deleting a row is similar except that runtime notifies you before and after the user action as well as the commits:

  • Delete Grid Rec Verify - Before

  • Delete Grid Rec Verify - After

  • Delete Grid Rec from DB - Before

  • Delete Grid Rec from DB - After

  • All Grid Recs Deleted from DB

Runtime notifies you of these user actions:

  • Column Selection Changed

    This event applies to check box grid columns only. Column Selection Changed fires if the user selects or clears an editable check box grid cell. It does not fire if the grid cell is modified by event rules.

  • Grid Column Clicked

    This event fires only if the grid column was configured as being clickable during design time.

  • Visual Assist Button Clicked and Post Visual Assist Clicked

    If you want to override the default UDC form that appears automatically in response to clicking the Visual Assist, these are the events to which to add the logic.

  • Aggregation Clicked

    This event applies to Support Aggregation column property and allows you to override the UDC form.

  • Double Click on Row Header

Finally, runtime signals as the user works through the grid, starting when the grid gets focus and ending when the grid loses focus.

  • Set Focus on Grid

    This event fires whether the user or runtime changes the focus.

  • Grid Cell Display Changed

    This event applies only to icon grid columns (those for which the Display Style property has been set to Icon.) The event fires and the cell's display icon setting changes whenever the value of the data in the cell changes. The value can change by fetching data, adding or updating records in a grid, setting the output parameter of a system or business function call, or by explicit ER assignment. It can therefore fire at many different times during the grid population, navigation and editing life cycle, including within other grid events.

    This event should reference a client-side NER, which internally calls the Set Grid Cell Icon system function, which sets the new icon or tooltip to display for the column. You should make only a simple, single reference to the system function. If you do not call this system function, the cell displays a blank image.

  • Column Selection Changed

    This event fires only if the column is a check box column (that is, the column Display Style-Default or Checkbox property has been set to Checkbox).

  • Row is Entered

  • Row is Selected (Web Only)

    This event fires on power forms and subforms only.

  • Row is Exited

    This event fires whenever a row is exited.

  • Row Exit & Changed - Inline

    This event fires after Row is Exited if the grid is an update grid and the row has been changed since the last time the row was exited.

    The Trigger Parallel Event system function is available for the Row Is Exited and Changed and Row Is Exited and Changed In-Line events. This system function will enable a parallel event to run on a separate thread and will not interfere with existing Event Rules.

  • Row is Exited & Changed - Asynch

    This event fires after Row Exit & Changed - Inline if the grid is losing focus, or if another row is entered. Row is Exited & Changed - Asynch is equivalent to validating the contents of the row. It is often used for the Edit Line master business function.

  • Kill Focus on Grid

    This event fires whether the user or runtime changes the focus.