SetProperties method: Grid class
Syntax
SetProperties(&Array)
Description
Use this method to set multiple properties (column enabled, column visibility, and column label) for one or more columns in a grid.
The SetProperties method of the Grid class can provide a noticeable performance improvement over multiple calls to set individual properties 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 SetProperties 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 four-dimensional array containing the column name, a value (Y/N) indicating whether the column is enabled, a value (Y/N) indicating whether the column is visible, and a value for the column label. |
Returns
None.
Example
&ARProp= CreateArrayRept(CreateArrayRept("", 4), 0);
&ARProp.Push(CreateArray("JOB_DETAIL", "Y", "Y", "Job Detail"));
&ARProp.Push(CreateArray("JOB_TIME", "Y", "Y", "Job Time"));
&mygrid.SetProperties(&ARProp);