.NET Customisation
User Guide
.NET Customisation
:
AVEVA C# Grid Control
: AVEVA Grid Control API
AVEVA
Grid Control API
The following table includes the API calls which have been made available for the Grid Control.
Note:
That you can only use the AVEVA C# Grid Control on your own Visual Studio form if you have a design time license for Infragistics.
Name
Type
Purpose
Data Source methods for populating the grid
BindToDataSource(NetDataSource)
Bind Grid to NetDataSource
NetDataSource(String TableName, Array Attributes, Array AttributeTitles, Array Elements)
Data Source constructor for database Attributes and database elements. The Grid will populate itself with database attribute values. The title of each column is represented by AttributeTitles.
NetDataSource(String TableName, Array Attributes, Array Elements)
Data Source constructor for database Attributes and database elements. The Grid will populate itself with database attribute values.
NetDataSource(String TableName, Array Attributes, Array Elements, String Tooltips)
Data Source constructor for database Attributes and database elements. The Grid will populate itself with database attribute values.
NetDataSource(String TableName, Array columns, Array of Array of rows)
Data Source constructor for column headings, and a set of row data. In this case the grid does NOT populate itself with database attribute values.
NetDataSource(String TableName, Array columns, Array of Array of rows, String Tooltips)
Data Source constructor for column headings, and a set of row data. In this case the grid does NOT populate itself with database attribute values.
NetDataSource(String TableName, string PathName)
Data Source constructor for import of an Excel XLS or CSV File
General methods available for the grid
allGridEvents(Boolean)
Switch Grid Events On or Off.
AllowDropInGrid(Boolean)
Allow drag/drop in the grid.
BulkEditableGrid(Boolean)
Allow/disallow cells to be bulk editable. Bulk edit mode allows multiple cells to be selected, and Fill down/Fill up operations to be performed. Copy and Paste operations will also apply to multiple cells selected in the same column.
ClearGrid()
Remove data & column headings.
ClearGridData()
Remove all of the row data from the grid.
ColumnExcelFilter(Boolean)
Allow/disallow Excel style filter on columns
ColumnSummaries(Boolean)
Allow/disallow Average, Count, etc on numeric columns
CreateValueList(String Name, Array for List)
Create a value list for the grid.
DisplayNulrefAs(String)
Nominate (or query) a text string to be used in grid cells that hold "Nulref" reference attribute data.
DisplayUnsetAs(String)
Nominate (or query) a text string to be used in grid cells that hold "unset" attribute data.
EditableGrid(Boolean)
Allow/disallow cells to be editable.
Note:
If the user is allowed to write data to the grid, then this data does not automatically get written back to the data source (or database). The BeforeCellUpdate event of the calling code is responsible for doing this synchronisation, and is in control of whether to either allow or disallow the change (Refer to
Add an Event to the Addin
for more detail). This does not enable the user to add/remove rows, just to edit the content of the existing cells.
ErrorIcon(Boolean)
Allow/disallow the display of the red icon in the cell if an attribute value or expression cannot be computed.
FeedbackFailColor(String)
Nominate (or query) the colour used to highlight cells where editing fails.
FeedbackSuccessColor(String)
Nominate (or query) the colour used to highlight cells successfully edited.
FixedHeaders(Boolean)
Allow/disallow fixed headers. (Useful when scrolling).
FixedRows(Boolean)
Allow/disallow fixing of rows (Useful when scrolling).
getDataSource()
NetDataSource
Returns the data source that has been set in the grid
GridHeight()
Real
Query the height of the rows in the grid.
GridHeight(Real)
Set the height of the rows in the grid.
HeaderSort(Boolean)
Allow/disallow the user to sort columns.
HideGroupByBox(Boolean)
Hide/show the groupBy box.
loadLayoutFromXml(String)
Load a stored grid layout into the current grid instance.
OutlookGroupStyle(Boolean)
Allow/disallow the Outlook Group style feature.
PrintPreview()
Opens a Print Preview of the grid instance (which also allows printing).
ReadOnlyCellColor(String)
Nominate (or query) the background colour used to indicate cells where editing is not permitted.
RefreshTable()
For a grid displaying Dabacon data this recalculates the content of every cell to refresh to the latest database state.
RefreshVisibleRegion()
For a grid displaying Dabacon data this recalculates the content of every cell in the visible region to refresh to the latest database state.
resetCellFeedback()
Reset the cell editing feedback highlight colour and tooltip text.
ResetColumnProperties()
Reset column layout.
saveGridToExcel(string excelFile,string worksheet, string strHeader)
Save the grid data to a designated worksheet of an Excel file. Here strHeader is a user supplied string which is output to the first row in the Excel spreadsheet. The grid data is then output starting in row #2.
SaveGridToExcel(string excelFile)
Save the grid data to an Excel file. Note that this will retain all grid groupings and layout of data. The String should specify the full pathname, eg: 'C:\temp\file.xls').
SaveGridToExcel(string excelFile, string worksheet)
Save the grid data to a designated worksheet of an Excel file. Note that this will retain all grid groupings and layout of data.
SaveLayoutToXml(String)
Save the grid layout (not data) to a file on the file system.
setAlternateRowColor(Red Num, Green Num, Blue Num)
Set alternate rows of the grid to a different colour. The default is: (251, 251, 255).
setAlternateRowColor(String)
Set alternate rows of the grid to a different colour.
setLabelVisibility(Boolean)
Show/hide the label which indicates the number of rows in the grid.
SingleRowSelection(Boolean)
Set grid to single row selection.
SplitGrid(Boolean)
Allow/disallow the user to split the grid horizontally and vertically.
SyntaxErrorColor(String)
Nominate (or query) the colour used to highlight cells containing syntactically invalid data.
Methods on rows in the grid
addRow(Array)
Add a single row of data. If the grid is based on database elements then the first element of the array is read. If not, then the Array data represents the data in each cell of the row.
clearRowSelection()
Clear row selection.
deleteRows(Array)
Delete one or more rows by row tag.
deleteSelectedRows()
Delete selected rows.
GetFilteredInRows()
Array
Return the rows which are contained in the current filter.
GetFilteredOutRows()
Array
Return the rows which are not contained in the current filter.
getNumberRows()
Real
Get the number of rows in the grid.
GetRow(string row)
Array
Get the cells in the row with the specified row tag.
GetRows()
Array of Array (rows)
Returns an array of all the row data.
GetSelectedRows()
Array of Array (rows)
Returns array of selected rows.
GetSelectedRowTags()
Array of row tags
Get the selected row tags.
MoveSelectedRowsDown()
Move the selected rows down in the grid.
MoveSelectedRowsUp()
Move the selected rows up in the grid.
RowAddDeleteGrid(Boolean)
Enable/disable row addition and deletion in the grid.
scrollSelectedRowToView(Boolean)
Scroll the selected row into view.
SelectAllRows()
Select all the rows in the grid.
SetRowColor(string rowTag, string colour)
Set the colour of the row to the named value.
SetRowColor(string row, real red, real green, real blue)
Set the colour of the row to the RGB value.
setRowTooltip(string row, string tooltip)
Set row tooltip to the specified string.
setSelectedRowTags(Array)
Programmatically select the given row tags.
Methods on columns in the grid
AutoFitColumns()
Resize columns to fit widest text.
ColumnsInGroupByBox()
Boolean
Returns true if there is at least one column in the GroupBy box.
ExtendLastColumn(Bool)
Extend the last column.
FixedHeaderOnColumns(string column, Boolean)
Fix the header on the column.
GetColumn(string column)
Array
Get the cells in the column with a specified tag.
GetColumnPosition(string column)
Real
Get the position of the column with the specified tag.
GetColumnTitle(string column)
String
Get the title of the column with the specified tag.
GetColumns()
Array of STRING
Get the columns in the grid.
GetTitles()
Array of strings
Get the titles for the grid.
GetNumberColumns()
REAL
Return the number of columns.
IsColumnVisible (string column)
Boolean
Query the visibility of the specified column.
ResetColumnFilters()
Reset all of the column filters.
ResizeAllColumns()
Resize columns to fit in available width of form.
setColumnColor(string column, string colour)
Set the column colour to a string (eg 'red')
SetColumnPosition(string, real)
Set the position of the column.
SetColumnTextAlignment(string column, string alignment)
Set the alignment of text in the column to CENTRE, CENTER, LEFT or RIGHT
SetColumnVisibility(String, Boolean)
Show/hide the specified column.
SetColumnWidth(string column, real width)
Set the column to a designated width.
setNameColumnImage()
Displays standard icons in a "NAME" attribute column when database elements are used.
SortColumnAscending(String)
Sort in ascending order the specified column.
SortColumnsAscending(Array)
Sort in ascending order the specified columns.
SortedColumnCollection()
Array
Get the sorted columns,
Methods on cells in the grid
DoDabaconCellUpdate(Array args)
This function is provided to support user code in the BeforeCellUpdate event when the grid is displaying Dabacon element/attribute data. The array provided as argument to the BeforeCellUpdate event can simply be passed on to this function to modify the Dabacon element/attribute in synchronisation with the cell data. If the function is unable to perform the modification for any reason the Array[3] and Array[4] values will be set to indicate the problem. For further information refer to
Add an Event to the Addin
.
GetCell(string rowTag, string columnTag)
STRING
Get the content of the cell in the specified row and column.
SetCellColor(string rowTag, string columnTag, string colour)
Set the colour of a cell (eg 'red').
SetCellColor(string rowTag, string columnTag, real red, real green, real blue)
Set the colour of the cell to the RGB value.
SetCellTextAlignment(string rowTag, string columnTag, string alignment), where alignment=CENTRE, CENTER, LEFT, RIGHT
Set the alignment of text in the cell to CENTRE, CENTER, LEFT or RIGHT.
setCellValue(string rowTag, string columnTag, string value)
Set a value in the cell.
setEditableCell(string rowTag, string columnTag, Boolean editable)
Enable/disable cell editing.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.