Displays data associated with many records; depending on the GeneXus object in which it is located, the Grid control also allows you to add, change, and/or delete data.
It can be used in Transaction objects, Web Panel objects, Panel objects (and also in Work With pattern and Work With objects and Work Panel objects).
It allows you to include both attributes and variables.
When used in a Transaction (grid with Base Table) it makes it possible to insert, update, and/or delete records in the corresponding associated table.
When used in a Web Panel (grid with/without Base Table, depending on whether it contains attributes and/or variables), it will display the data stored in tables; the variables can also accept values.
To add a grid to the selected location, drag the Grid icon () from the Toolbox to the Form/Layout. This will open the Selector window to select which attributes/variables you want to include inside it:
You can select multiple lines by clicking on them while holding down the Shift or Ctrl keys. When the selection is finished, the selected attributes and/or variables will be inserted in the grid.
When used in a Web Panel object, the Grid will contain one column for each attribute/variable:
When used in a Panel object, there is more flexibility regarding the location of the attributes/variables in the Grid (they can be on one side, below, above, or between them).
The order of the attributes/variables can be switched. To do so, select the attribute/variable to move, and an arrow will be displayed that indicates the possible new location. Then, drop it at the desired location.
You can add more attributes/variables by right-clicking one of the attributes and selecting in the contextual menu: Insert Attribute/Variable
You can also drag & drop an attribute/variable from the Toolbox in the grid.
If you select the entire grid, the copy/cut/paste/etc. options will be available in the Edit option of the IDE; regular shortcuts (Ctrl+C, Ctrl+V, etc.) also work.
Tip: To quickly select a grid, position the mouse cursor on the upper part of the control, as shown in the figure below.
- When used in Web Panel objects, a Grid cannot be nested in another, but you can use a Free Style Grid control which can contain a Grid. On the other hand, when used in Panel objects, a Grid control can contain another grid.
- By default, every attribute and variable inside a Grid of a Web Panel, Panel, or Work With object is displayed as read-only at runtime and cannot be changed. However, data can be accepted in the variables depending on the programming of the events existing in the object. Read about it here: Working with Grids in Web Panels.
- Grids included in Panel objects offer the Control Type property which allows presenting the data with varied and interesting formats.
- Grids allow for paging, which can be automatically performed by GeneXus (read more about it here: Automatic paging in Grid control).
- The contents of columns can be ordered automatically, with no need for programming any additional code. The user can order the columns by clicking on their titles, as shown in the images below: