Nested Grids

Official Content
This documentation is valid for:

Nested grids can be defined in a Web Panel object. They consist of a Free Style Grid control into which another grid can be inserted in a cell. Each grid can be a Free Style or Grid control grid; however, if it is a standard grid it cannot have nested grids.

There can be nested grids at several levels, and there can also be parallel nested grids. It's like a tree where each node is a grid. Regular grids can only be the leaves of the nesting tree.

For example, say we want to create a Web Panel that shows service providers, indented by category:

Hotels  
  Hotel Colonia
  Hotel Oceanía
Transport  
  Alfa Travel
  OtherWorld Travel
...  

 

To do so, we create a Free Style grid with the category and inside it we insert another grid with service providers (the grid can be standard or Free Style).

Finding Base Tables

Nested grids follow the same relationship rules as nested For Each command. Therefore, GeneXus finds each grid's base table (they aren't completely independent: the main grid's base table will influence the finding of the nested grid's base table).

Next, based on these findings it defines the navigations it will make for each grid. The grids' logic will depend on the relationships found between said tables.

If there isn't a base table, the data should be loaded with the Load command.

Triggering Events

Each grid maintains its own Load event and Refresh event. Every time the Load command is executed in a grid with nested grids, a call is made to each child's Refresh and Load event.