EnableColumns method: Grid class
Syntax
EnableColumns(&Array)
Description
Use this method to enable or disable one or more columns in a grid. When a column is enabled, it is editable; when it’s disabled, it is not editable.
The EnableColumns method of the Grid class can provide a noticeable performance improvement over multiple calls to set the Enabled 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 EnableColumns 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 (Y/N) indicating whether the column is enabled. |
Returns
None.
Example
&AREnable = CreateArrayRept(CreateArrayRept("", 2), 0);
&AREnable.Push(CreateArray("JOB_DETAIL", "Y"));
&AREnable.Push(CreateArray("JOB_TIME", "Y"));
&myGrid.EnableColumns(&AREnable);
Related Topics