The CygNet GCM Nomination Grid Control object contains the following methods:
The AboutBox method displays an About dialog box for the control.
AboutBox()
Example
The following example displays the CygNet About dialog box.
|
Sub ShowAboutBox() NomGridCtrl.AboutBox End Sub |
The ApplyUnitSet method changes the current units to a predefined set.
ApplyUnitsSet(nUnitsSet As Integer)
| Parameter | Required | Description |
|---|---|---|
| nUnitsSet | Yes |
The unit set number indicated in the set name. |
Example
|
Sub cboDisplayUnitSet_EventChange() Dim This : Set This = cboDisplayUnitSet Dim iSelection iSelection = this.Selection
'NomGridCtrl1.StopAllActivity
If iSelection = 0 Then NomGridCtrl1.ApplyUnitsSet 0 Elseif iSelection = 1 Then NomGridCtrl1.ApplyUnitsSet 1 Else msgbox "Invalid selection of " & iSelection, vbOkonly, "Unexpected Error" End If
On Error Resume Next Dim iRebuildResult iRebuildResult = NomGridCtrl1.Rebuild()
If iRebuildResult <> 0 Then msgbox "Grid rebuild failed with code " & iRebuildResult, vbOkonly, "Rebuild Error" End If
End Sub |
The Clear method clears the contents and values of the object.
Clear
Example
The following example will clear all values from the GCM Nomination Grid.
|
Sub Clear() NomGridCtrl.Clear End Sub |
The Export method exports the contents of the grid to a temporary CSV file and opens the file with the default spreadsheet viewer for the user to view and save to disk.
Export()
Example
The following example exports the data in the GCM Nomination Grid to a CSV file.
|
Sub NomGridCtrl1_EventRefreshComplete() Dim This : Set This = NomGridCtrl1 If bIsExported = False Then this.Export bIsExported = True End If End Sub |
The ExportToFile method exports the contents of the grid to a specified CSV file.
ExportToFile(strExportFileFullPathName As String)
| Parameter | Required | Description |
|---|---|---|
|
strExportFileFullPathName |
Yes |
The file path or blob path to the CSV file to receive the exported data. |
Example
The following example exports the data in the GCM Nomination Grid to a CSV file located at C:\GcmExport.csv.
|
Sub ExportToFileButton_EventClick() NomGridCtrl1.ExportToFile "C:\GcmExport.csv" End Sub |
The GetCellText method gets the text of the cell specified by row and column.
GetCellText(nRowIndex As Integer, nColumnIndex As Integer) As String
| Parameter | Required | Description |
|---|---|---|
|
nRowIndex |
Yes |
The zero-based index of the row to select. |
|
nColumnIndex |
Yes |
The zero-based index of the column to select. |
Example
The following example returns the text of the cell specified by row and column.
|
strCellText = NomGridCtrl1.GetCellText(1, 0) |
The GetCellTextByFacility method gets the text of the cell specified by given Facilty and column.
GetCellTextByFacility(strFacTag As String, nColumnIndex As Integer) As String
| Parameter | Required | Description |
|---|---|---|
|
strFacTag |
Yes |
The tag of the facility for which to retrieve a value. |
|
nColumnIndex |
Yes |
The zero-based index of the column to select. |
Example
The following example gets the text of column 0 for the facility LVL1_1.
|
strCellText = NomGridCtrl1.GetCellTextByFacility("MY_SITE.UIS::LVL1_1", 0) |
The Print method prints the contents of the control, grid, or viewer. When this method is called, the Print dialog box is shown to allow configuration.
Print()
Example
The following method prints contents of the CygNet GCM Nomination Grid control when a button is pressed.
|
Sub ButtonTool1_EventClick() Dim This : Set This = ButtonTool1 NomGridCtrl.Print End Sub |
The Rebuild method re-reads the Group Service (GRP) hierarchy and Current Value Service (CVS), then redraws the grid and refreshes the data.
Rebuild As Integer
Example
|
Sub NomGridCtrl1_EventInitialize() Dim This : Set This = NomGridCtrl1 this.HistoricalDate = now() this.Rebuild bIsExported = False End Sub |
The Refresh method refreshes the contents of the control from the Current Value Service (CVS).
Refresh()
Example
The following example refreshes the CygNet GCM Nomination Grid control when a button is pressed.
|
Sub ButtonTool1_EventClick() Dim This : Set This = ButtonTool1 NomGridCtrl1.Refresh End Sub |
The StopAllActivity method stops all work if the grid is building. Call this method when closing the screen.
StopAllActivity As Integer
Example
See example above for ApplyUnitSet.