Grid control

Official Content
This documentation is valid for:

The Grid control displays data associated with many records. In some cases, it also allows entering, updating, and deleting data.

You can include a Grid control in GeneXus objects with UI (User Interface/screen).

The Grid control has different capabilities depending on the object in which it is located. It is important to understand them.

Grids in Web Panels and Transactions

Grids in Web Panel objects and Transaction objects contain structured columns (each one containing an attribute or a variable) and each column has a title.

They are usually called Standard Grids.

If you need to design a more flexible distribution of the attributes/variables for the lines of the Grid (or you need to add another Grid or other controls inside a Grid), use the Free Style Grid control.

Grids in Panels

When you add a Grid control in a Panel object and select the attributes/variables to be included inside it, by default, they are located one beside the other.

image_2023922194133_1_png

If you leave this kind of distribution, at runtime you will see a result very similar to a Grid that contains columns, but, strictly, they are not columns.

You can move those attributes/variables with freedom. For example, instead of displaying, for each attraction, the attributes/variables values one beside the other, you can move and place the attributes/variables as you wish to be displayed for each attraction.

image_2023922194720_1_png

In addition, you can include another Grid (or other controls) inside a Grid present in a Panel. 

That is to say, the Grid control in Panels offers the same behavior as the Free Style Grid control in Web Panels and Transactions.

Moreover, Grids included in Panel objects have the Control Type property which allows presenting the data with interesting formats.

Note: The Tabular Grid control is available to be inserted in Panels since GeneXus 18 Upgrade 3 when using the GeneXus Angular Generator.

How to add a Grid

You have different ways to add a Grid:

  1. Drag the Grid icon from the Toolbox to the desired location on the Web Layout of the Web Panel / Layout of the Panel. 
  2. Select Insert > Grid from the GeneXus main menu.

Next, a Selector window will be opened to select which attributes/variables you want to include in the Grid.

Behavior according to the object in which the Grid is located

Web Panel / Panel Transaction
Attributes included in the Grid are always read-only. They are queried and displayed. You can't change this behavior.
  • Not inferred attributes included in the Grid are editable by default. You can change this behavior if needed. Check NoAccept rule.
  • Inferred attributes included in the Grid are read-only. You can change this behavior if needed. Check Update rule

Variables included in the Grid are, by default, read-only.

However, data can be accepted in Grid variables depending on the events programmed in the object:

1. If inside an event you are using the For Each Line command.
2. If the Grid includes a control with an associated Click event.

When one of these cases occurs, all variables inside the Grid become input variables. You can define which variables can't be modified by using the NoAccept rule or by setting the variable Read Only property to True.

Variables included in the Grid are read-only by default. You can change this behavior if needed. Check Accept rule.
The main objective of the Grid control in these objects is to query data.   The main objective of the Grid control in Transactions is to allow to insert, update, and/or delete records in the corresponding associated table.
The Grid control behavior is different in other use cases such as when including variables based on SDTs. Check SDTs on Forms The Grid control behavior is different when used in Dynamic Transactions.

 

Runtime features of Grids

  • Grids allow for paging, which can be automatically performed by GeneXus. Check 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.

Subcribe to this category's changes
Sub CategoriesAdd a new subcategory in this category
PagesAdd a new page in this category