Grid

GridIcon Description

This page explains the generic features of Grid nodes. These nodes are used in web panels created with K2BWebPanelDesigner to include GeneXus grids in them.

If you need information about grid nodes in SD Designer instead of Web Panel Designer, check out this page.

Grid nodes are among the most complex nodes used in K2BWebPanelDesigner. This occurs mainly because there are many ways the grid can obtain its data. Currently, five types of grids are available:

  1. Grids with base table
  2. Grids with an inferred for each
  3. Grids based on data providers
  4. Grids with no base table
  5. Grids based on SDT's

In the following sections, generic properties referring to all five types will be explained. To see details regarding one of the types shown above, please go to the specific page.

Runtime appearance

The grid node's runtime appearance depends on the "WebPanelDesignerLayout" object. This object is imported into the KB when K2BWebPanelDesigner is used for the first time in it, and can be modified later to suit the developer's needs. Note that modifying this object affects all web panels generated. Using the default implementation, the appearance will be the one shown below.

GridInstance GridRT
Grid instance Run time appearance of grid instance

 To change this default appearance, see Using WebPanelDesigner Layout Object.

Properties

In this section only generic grid properties are shown. Specific properties for each type of grid can be found on the page specific to the type.

Category Name Value
General Name (Id) The grid's name. Must be unique within the web panel.
Allow Runtime Column Selection Determines if this grid will have Runtime column selection enabled.
Conditional Row Classes Contains a set of conditions that determine different formattings for the grid rows based on their content. See Conditional classes in grids
Page Indicates the amount of rows to display per grid page. If set to zero, no paging will be generated and all available items will be shown.
Page Options Determines the options available in the Rows Per Page field inside the grid settings control.
Hide Paging Bar If One Page If set to "True", the paging bar will be shown only if more than one page are available. If set to "False", it will be shown always.
Add User Subroutines To Paging Events Determines if K2BWebPanelDesigner should include calls to user subroutines in paging events.
Custom Render

Indicates if the grid should be rendered using the default GeneXus implementation, or should be rendered using an User Control designed for that purpose.

Note: Not avialable if generating web panels with Responsive Web Design.

Behaviour Allow Selection Set to true the grid property allow selection. For more information see guide How to use AllowSelection in Grids.
Allow Drop Contains the value for the Allow Drop property in GeneXus.
Generate Drop Event Indicates if Web Panel Designer should generate the subroutine necessary to handle the drop event.
Allow Drag Contains the value for the Allow Drag property in GeneXus.
Generate Drag Event Indicates if Web Panel Designer should generate the subroutine necessary to handle the drag event.
Theme Theme Class theme that should be used when rendering the grid
Grid container class Class theme that should be used when rendering the grid's container section.
Scroll Determines if the grid should be inside a scrollable section.
MultiRow Force Multirow

Forces checkboxes to appear on the grid if set to "True".

Note: This property is not available when using the grid inside a MultipleSelection control, as in that case the grid checkboxes appear by default.

State Save Grid State Determines if the state of this grid's filters should be saved in order to recover them if the user switches between screens.

User subroutines associated to this node

Note: In this section only generic user events are shown. Specific events for each type of grid can be found on the page to the type.

In the following table, {InternalName} should be replaced with the value of the property "Name (Id)" of the grid.

Name Moment of execution Detailed description and possible uses
U_PagingFirst({InternalName}) Before moving to the first page of the grid

This subroutine is executed before changing the page being displayed. This can be useful if the user wishes to save values shown on the grid that haven't been persisted already.

Note: this user subroutine is generated only if the developer has set the property "Add User Subroutines To Paging Events" to "true".

U_PagingPrevious({InternalName}) Before moving to the previous page of the grid

This subroutine is executed before changing the page being displayed. This can be useful if the user wishes to save values shown on the grid that haven't been persisted already.

Note: this user subroutine is generated only if the developer has set the property "Add User Subroutines To Paging Events" to "true".

U_PagingNext({InternalName}) Before moving to the next page of the grid

This subroutine is executed before changing the page being displayed. This can be useful if the user wishes to save values shown on the grid that haven't been persisted already.

Note: this user subroutine is generated only if the developer has set the property "Add User Subroutines To Paging Events" to "true".

U_PagingLast({InternalName}) Before moving to the last page of the grid

This subroutine is executed before changing the page being displayed. This can be useful if the user wishes to save values shown on the grid that haven't been persisted already.

Note: this user subroutine is generated only if the developer has set the property "Add User Subroutines To Paging Events" to "true".

U_Search({InternalName}) Before pressing search button asociated with the grid.

This subroutine is executed after pressing the search button. This can be useful if  the developer wishes to change the value of a variable when search button is pressed.  

One use case is when the developer doesn't want to load grid records on page load. A condition can be placed in the grid stating that a variable must be true (Ex:&Filter=True) . Then, inside the subroutine "U_OpenPage" the developer must set &Filter=False and in this subroutine change it to &Filter = True in order to start loading records when the final user presses the search button. 

Child nodes

Grid nodes have specific children with special meanings. Unlike other types of node, in this case the children of the node define its behavior. Also, in many cases there can only be one node of a certain type inside the grid. Available nodes, and their purposes, are:

  • ColumnsIcon Columns (grid). This node is used to define which will be the columns included in the grid. It has no relation to the Columns type of node, as they serve very different purposes. As this defines the columns that are shown on the grid, only one of these nodes can appear on a certain grid. Also because of this, it is mandatory that one node of this type exists on the grid.
  • FiltersIcon Filters. This node is used to define which will be the filters specific to this grid. It is important to note that nodes of this type can never appear outside grids, as their purpose is tightly connected to the grid itself. These nodes can appear at most once inside each grid.
  • OrdersIcon Orders. This node is used to define which will be the orders generated for this grid. These nodes can appear at most once inside each grid.
  • AttributesIcon Summary. This node can be used to present a summary of the data shown in the grid. For example, this could be used to display a total amount calculated from the values of a particular column.
  • ActionsIcon Actions. This node contains Action nodes that should appear alongside the grid. Actions included in this node will not be shown as In-Grid actions (as defined in the Action page). If the developer wishes to include actions inside the grid, they must be included in the Columns (grid) node.