Enabling User Grid Column Adjustments

Describes the ADJUSTABLE-COLUMNS and MOVEABLE-COLUMNS styles that enable users to move, resize, and hide grid columns.

By default, the program fixes the grid layout, and the user cannot change it. However, setting one or both of the following styles enables users to modify column position and size:

ADJUSTABLE-COLUMNS (value 512)

Enables grid column size to be adjusted by dragging a column header divider with the mouse.

The minimum column size is 0. When dragged to zero, the column is entirely hidden, and displays a small mark to indicate the location of the hidden column. To restore a hidden column, hover over the mark, and then click the resulting image. When a column is hidden, the runtime sends a MSG-COLUMN-SHOW event to the COBOL program.

The maximum column size is the visible portion of the grid. If the grid allows for horizontal scrolling, the VIRTUAL-WIDTH property changes as the user changes column sizes.

When the user changes a column size, the program is informed via a MSG-COL-WIDTH-CHANGED message. Because grids use integer character widths for measuring columns, the grid automatically adjusts the location given by the user to the nearest character position.

Restrictions: The following restrictions apply to the ADJUSTABLE-COLUMNS style:
  • The grid can contain no more than one row per record
  • Single-column grids are not adjustable because the column already occupies all of the grid's display space. If ADJUSTABLE-COLUMNS is set on a single-column grid, the column might appear to be adjustable, but when the user releases the mouse after dragging to change the width, the column returns to its original width.
  • Columns may not be dragged to the left of any row headers

MOVEABLE-COLUMNS (value 4096)

Enables grid columns to be moved by dragging a column header to a new position, and dropping the column when arrows appear at the desired location.

When a column is moved, the runtime sends a MSG-COLUMN-MOVED event to the COBOL program.

Restrictions: The following restrictions apply to the MOVEABLE-COLUMNS style:
  • The grid can contain no more than one row per record
  • The grid must have column headers
  • Columns may not be dragged to the left of any row headers
  • When NUM-COL-HEADINGS is > 1, this effectively turns off the MOVEABLE-COLUMNS style. For more information, see NUM-COL-HEADINGS.