LabelColumns method: Grid class
Syntax
LabelColumns(&Array)
Description
Use this method to set the display label for one or more columns in a grid.
The LabelColumns method of the Grid class can provide a noticeable performance improvement over multiple calls to set the Label property of the GridColumn class. Each call manipulating a grid (either using a Grid class method or setting a GridColumn property) has a significant, and similar performance overhead. Therefore, one key to increasing the performance of PeopleCode programs manipulating grids is to reduce the number of these calls. Performance testing data suggests that if your program is changing three or more columns, use one of the Grid class methods, such as the LabelColumns method, instead of setting the column properties directly. The single call to the Grid class method offsets the small overhead of creating and populating the required array.
Parameters
| Parameter | Description |
|---|---|
|
&Array |
Specify a two-dimensional array containing the column name and a value for the column label. |
Returns
None.
Example
&ARLabel= CreateArrayRept(CreateArrayRept("", 2), 0);
&ARLabel.Push(CreateArray("JOB_DETAIL", "Job Detail"));
&ARLabel.Push(CreateArray("JOB_TIME", "Job Time"));
&myGrid.LabelColumns(&ARLabel);
Related Topics