Grid controls

When interrogating grids or tables in Java applications and Remedy, Studio creates a Grid control. The control has standard control properties, methods, and events along with those which let you extract the grid data and work with individual cells, rows, and columns.

Definitions of the grid properties, methods, and events follow. For more information, see General Windows Control Properties, Methods, and Events.

 

Properties

Property

Description

ColumnCount
(Int32 type)

Gets the number of columns currently in the grid.

ColumnHeaders

Gets a list containing the column headers of the grid. The ListLoop component can be used to iterate through the ColumnHeaders output.

DataTable

Gets a DataTable containing the rows and columns of the grid. The DataTable contains all the same columns that are contained in the original grid, plus an Index column. The columns' names will come from the headers of the original grid.

 If a header is blank in the original grid, it will get a generated name such as "Column1", "Column2", and so on. You can use the TableView control  to send the data from the grid to a Windows form.

RowCount
(Int32 type)

Gets the number of rows currently in the grid.

SelectedColumn
(Int32 type)

Gets the index of the selected column. The first column is index 0 (zero).

SelectedRow
(Int32 type)

Gets the index of the selected row. The first row is index 0 (zero).

 

Events

Event

Description

GridCellClicked

Occurs when a user clicks on cell or the PerformClick method is called for the cell.

GridCellDoubleClicked

Occurs when a user double-clicks on cell or the PerformClick method is called for the cell.

GridCellSelected

Occurs when a user selects a cell via  mouse-click or keyboard command.

 

Methods

These methods are used to perform an action on a specific Grid cell, column or row. To designate the appropriate element, the methods provide various parameter options, such as row/column index, column name, and string expression. The string expression parameter uses specific expression syntax. For more information, see Expression Method Parameter. For example, using the FindRow(expression) method, the format for an expression could be: [Column Name]='value'. In this case, to search for the value "Monica" in the column "FirstName", the expression would be: [FirstName]='Monica'.

Note: For any of the methods which use expression parameters, if Studio is unable to find a match at runtime the OpenSpan.Adapters.ExpressionMatchNotFoundException exception occurs. When using text strings to identify a column, the string must provide an exact match to the item text.

Method

Description

Parameters

Return Type

ClickCell

Raises the click event on the cell specified by the row and column index values.

Int32 row, Int32 Column

Void

ClickCell

Raises the click event on the cell specified by the row index value and column name.

Int32 row, String column name

Void

ClickCell

 

Raises the click event on the cell specified by the column index and cell value which satisfies the expression. If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

String expression, Int32 column index

Void

ClickCell

Raises the double-click event on the cell specified by the column name and cell value which satisfies the expression. If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

String expression, String column name

Void

DoubleClickCell

Raises the double-click event on the cell specified by the row and column index values.

Int32 row, Int32 Column

Void

DoubleClickCell

Raises the double-click event on the cell specified by the row index value and column name.

Int32 row, String column name

Void

DoubleClickCell

Raises the double-click event on the cell specified by the column index and cell value which satisfies the expression. If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

String expression, Int32 column index

Void

DoubleClickCell

Raises the double-click event on the cell specified by the column name and cell value which satisfies the expression. If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

String expression, String column name

Void

EnsureVisible

Use this method to scroll through the grid until the cell identified by the row and column index values is visible.

Int32 row, Int32 Column

Void

EnsureVisible

Use this method to scroll through the grid until the cell identified by the row index and column name is visible.

Int32 row, String column name

Void

EnsureVisible

Use this method to scroll through the grid until the cell identified by the column index and cell value which satisfies the expression is visible. If more than one cell matches the expression, Studio scrolls to the cell for the first matching occurrence.

String expression, Int32 column index

Void

EnsureVisible

Use this method to scroll through the grid until the cell identified by the column name and cell value which satisfies the expression is visible. If more than one cell matches the expression, Studio scrolls to the cell for the first matching occurrence.

String expression, String column name

Void

FindRow

Searches the grid for the column and value specified by the expression and returns the index of the first row where a match is found.

String expression

Int32

FindRow

Searches the column specified by the column index parameter for the value specified by the string value parameter and returns the index of the first row where a match is found.

Int32 column index, String cell value

Int32

FindRow

Searches the column specified by the column name parameter for the value specified by the string value parameter and returns the index of the first row where a match is found.

String column name, String cell value

Void

FindRows

Returns a list of row indexes that match the given expression which defines the column and value. For example, the expression: [Author] LIKE 'A*' returns the indices for all rows in the Author column that start with the letter A.

None

Void

GetCellValue

Returns the value of cell identified by the row index and column index parameters.

Int32 row, Int32 Column

String

GetCellValue

Returns the value of cell identified by the row index and column name parameters.

Int32 row, String Column name

String

GetCellValue

Searches the column (designated by the column index parameters) for cell matching the input expression parameter and then returns the value of the cell. Note that if more than one cell matches the expression, Studio returns the value of the cell for the first matching occurrence.

String expression, Int32 column

String

GetCellValue

Searches the column (designated by the column name parameters) for cell matching the input expression parameter and then returns the value of the cell. Note that if more than one cell matches the expression, Studio returns the value of the cell for the first matching occurrence.

String expression, String columnName

String

SelectCell

Selects the cell identified by the row index and column index parameters.

Int32 row, Int32 Column

Void

SelectCell

Selects the cell identified by the row index and column name parameters.

Int32 row, String Column name

Void

SelectCell

Selects the cell specified by the column index and cell value which satisfies the expression.

String expression, Int32 column index

Void

SelectCell

Selects the cell specified by the column name and cell value which satisfies the expression.

String expression, String column name

Void

SelectColumn

Focuses (or removes focus) for the column identified by the column index parameter. To focus the column, set the focus parameter to True. To remove focus from the column, set the focus parameter to False.

Int32 column, Boolean value

Void

SelectColumn

Focuses (or removes focus) for the column identified by the column name parameter. To focus the column, set the focus parameter to True. To remove focus from the column, set the focus parameter to False.

String columnName, Boolean value

Void

SelectRow

Focuses (or removes focus) for the row identified by the row index parameter. To focus the row, set the focus parameter to True. To remove focus from the row, set the focus parameter to False.

Int32 row, Boolean value

Void

SelectRow

Focuses (or removes focus) for the row identified by the expression parameter. To focus the row, set the focus parameter to True. To remove focus from the row, set the focus parameter to False.  

String expression, Boolean value

Void

SetCellValue

Sets the value of cell, identified by the row index and column index, to the string value.

Int32 row, Int32 Column, String value

Void

SetCellValue

Sets the value of cell, identified by the row index and column name, to the string value.

Int32 row, String columnName, String value

Void

SetCellValue

Set the value of cell in the first row that matches the given expression and column index.

String expression, Int32 column, String value

Void

SetCellValue

Set the value of cell in the first row that matches the given expression and column name.

String expression, String columnName, String value

Void

 

Related information

Updating Controls on WinForms

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label