Lock columns
- Last Updated: April 12, 2024
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
You can use the NUM-LOCKED-COLUMNS attribute to prevent one or more
browse columns from scrolling out of the browse viewport when the horizontal scrollbar
is used. A nonhorizontal-scrolling column is referred to as a locked column.
Locked columns are always the leftmost columns in the browse. In other words, if you set
NUM-LOCKED-COLUMNS to 2, the first two columns listed in the
DEFINE BROWSE statement are locked. In the next example, the
Order Number and Order Date never move
out of the browse viewport, no matter which of the remaining fields the user accesses
with the horizontal scrollbar.
To experiment with locking columns:
- Double-click on the OrderBrowse to go into its property sheet.
- Click the Fields button to edit the field list.
- Click the Add button and add all the rest of the Order fields to the browse. Do not add any Customer fields, as they just repeat all the values from the Customer record you are already displaying above the browse.
- Back in the property sheet, set Locked Columns to
2. The AppBuilder generates a statement from this setting
to set the
NUM-LOCKED-COLUMNSattribute at run time, because this attribute cannot be set using a keyword in theDEFINE BROWSEstatement:ASSIGN OrderBrowse:NUM-LOCKED-COLUMNS IN FRAME CustQuery = 2. - Run the window again. You can scroll through all the rest of the
Ordercolumns, but the first two columns are always displayed: