Download PDMS PML Manual - 2 PDF

TitlePDMS PML Manual - 2
File Size7.5 MB
Total Pages78
Document Text Contents
Page 78

AVEVA PDMS Programmable Macro Language manual

2016 v.1. Page 178/178

24.3. Grid Control

Another example of an available .NET object is the Grid Control gadget. Despite
appearing similar to a LIST gadget, the Grid Control gadget has a large number of methods
available to it allowing it to behave more like a spreadsheet. Some of the advantages are as

• Data in the grid can be selected, sorted and filtered.
• Data in the grid can be exported to/imported from a Microsoft Excel file
• Grid contents can be previewed and printed directly
• The colour of rows, columns or cells can be set (including icons)
• The values of entire rows/columns can be extracted/set
• The contents of the grid can be filled based on DB elements and their attributes

24.3.1. Applying Data to the Grid

Data is applied to a Grid Control gadget through the use of a NETDATASOURCE object.
While defining this object, the required data is collected and formatted for the grid. The data
is applied to the grid by using its .BindToDataSource() method. For example:

var !coll collect all EQUI
!data = object NetDataSource(‘Example Grid, !attrib s.split(), !coll)

24.3.2. Events and Callbacks

The following events are available on the grid:

• OnPopup(Array)
- Array[0] is the x coordinate of the current cursor position
- Array[1] is the y coordinate of the current cursor position
- Array[2] contains the ID of each of the selected rows

• BeforeCellUpdate(Array)
- Array[0] is the new value the user typed in
- Array[1] is the Row Tag of the cell
- Array[2] is the Column key of the cell
- Array[3] is a Boolean. If you set it to “false” then the new value will NOT be allowed

• AfterSelectChange(Array)
- The array contains the ID of each of the selected rows
- AfterCellUpdate
- No arguments are passed.

Similer Documents